2010-10-21 37 views
0
RewriteRule ^photographs/?$ photographs.php [L] 
RewriteRule ^photographs/(.*)/?$ photographs.php?cat=$1 [L,QSA] 
RewriteRule ^photographs/(.*)/(.*)/?$ photographs.php?cat=$1&page=$2 [L,QSA] 

我想这能有其他选择,如的URL有条件的.htaccess

  • /照片
  • /照片/类别
  • /照片/分类/ 3

谢谢

+0

不确定你想要完成什么 – Anon 2010-10-21 16:52:21

回答

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

这是因为(.*)也匹配/字符。