Forum Moderators: phranque
points to photos.php?mak=$mak&mod=$mod
this rule works only if the $mod does not contain any "-"
if the $mod contains any "-" it automatically uses the Rule below
RewriteRule ^([^-]+)[-](.*)\.php$ /phone.php?mak=$1&mod=$2 [NC,L]
i want to get rid of the .* as pointed.
is there any way i can check for 2 occurences of a "-"
the model field will not have more than 2 "-" s
my urls will be either
(1)brand-model.php
or
(2)brand-m-od-el.php
(1)its solved
RewriteRule ^([^-]+)[-]([^-]+)\.php$ /phonemodel.php?mak=$1&mod=$2 [NC,L]
(2)Clueless
shall i go for RewriteCond?
needing your help...thanks
varun
The basic problem is to declare a "separator" character that will not (and must not) appear in the brand name. Otherwise, you will not be able to write a regular expressions pattern to separate the brand and model number. So, the separator character must be unique.
If you are sure that hyphens "-" will never appear in the brand name, then the rule
RewriteRule ^([^-]+)-(.+)\.php$ /phonemodel.php?mak=$1&mod=$2 [NC,L]
Jim