Forum Moderators: phranque

Message Too Old, No Replies

sorry for troublin

         

varunkrish

8:19 am on May 27, 2005 (gmt 0)

10+ Year Member



i need a page url like

www.site.com/make-model-photos.php

it points to photosmodel.php?mak=$1&mod=$2

i used the rewrite below and its not working please help..

RewriteRule ^([^-]+)(-)[^-]+)-photos(.*)\.php& /photosmodel.php?mak=$1&mod=$2 [NC,L]

jd01

7:26 pm on May 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi varunkrish,

RewriteRule ^([^-]+)(-)[^-]+)-photos(.*)\.php& /photosmodel.php?mak=$1&mod=$2 [NC,L]

I think there are three problems:
() defines a variable, so variable 2, $2, will always be -.
Your rule ends with & and should end with $. Only files that are formatted as your-file-photos.php& will qualify.
You are missing a ( on your third variable.

I would recommend:
RewriteRule ^([^-]+)-([^-]+)-photos(.*)\.php$ /photosmodel.php?mak=$1&mod=$2 [NC,L]

I am not sure what this (.*) is in your rule for, but [^.]* may prove to be more efficient.

Hope this helps.

Justin