Forum Moderators: phranque
it points to phonemodel.php?mak=$mak&mod=$mod
suppose if i have a hyphen in the model field during request
ex:site.com/myx-5.php
the url rewrite not working
similarly
if if i have a hyphen space in the model field during request
ex.site.com/MY X-3.php
the url rewrite not working
is there a way to handle these cases or should i go for modifying database info?
Spaces are not valid characters for use in URLs. They must be encoded as %20.
Jim
Underscore joins the two words together into one single word, and will only help your ranking when people actually search for "Nokia_123" (including the underscore) and not for searches on "Nokia 123". The other characters above will match better.
Jim
Just a quick thought and then I'll let you two go back to what you were doing.
I think you might be better off to do something like this:
RewriteRule ^([^-]+)[-]([^-]+)\.php$ /phonemodel.php?mak=$1&mod=$2 [NC,L]
RewriteRule ^([^-]+)[-](.*)\.php$ /phonemodel.php?mak=$1&mod=$2 [NC,L]
The first rule will only qualify for requests with a single - then you can send them where you would like.
The second rule will catch any requests with multiple -'s and you can send them where you would like...
So, you could 'catch' models with a single hyphen and send them to a specific URL, and then you could catch 'makes' and 'models' and send them to another specific URL. (Of course the number of hyphens has to be correct for this to work EG 1 or more than 1, but if they are you could have the best of both worlds... hyphens and redirects.)
Hope this helps or gives another idea.
Justin