【发布时间】:2009-06-26 09:22:34
【问题描述】:
目前,我的 .htaccess 文件看起来像 htis:
IndexIgnore */*
RewriteEngine on
RewriteRule ^add /add.php
RewriteRule ^add/$ add.php
RewriteRule ^sitemap.xml /xmlsitemap.php
RewriteRule ^([^/\.]+)$ /index.php?slug=$1
RewriteRule ^([^/\.]+)/$ /index.php?slug=$1
它适用于以下链接:site.com/category/
但是,我想要 site.com/ 之后的完整 slug。这样我就可以重定向 site.com/category1/subcategory2/subsubcategory3 等。一个类别中可能有未知数量的子类别。
我尝试了 request_uri,但并没有真正奏效。
如何做到这一点?非常感谢!
【问题讨论】:
标签: .htaccess mod-rewrite conditional