开发者

Conditional .htaccess for URL

RewriteRu开发者_运维技巧le ^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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜