tags:

views:

19

answers:

1
RewriteRule ^photographs/?$ photographs.php [L]
RewriteRule ^photographs/(.*)/?$ photographs.php?cat=$1 [L,QSA]
RewriteRule ^photographs/(.*)/(.*)/?$  photographs.php?cat=$1&page=$2 [L,QSA]

I need this to have options such as

  • /photographs
  • /photographs/category
  • /photographs/category/3

Thanks

+1  A: 
RewriteRule ^photographs/?$ index.php [L]
RewriteRule ^photographs/([^/]+)/?$ index.php?cat=$1 [L,QSA]
RewriteRule ^photographs/([^/]+)/([^/]+)/?$  index.php?cat=$1&page=$2 [L,QSA]

That's because (.*) also matches / character.

Nitram Saneco