目前,我的 .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 但这并没有真正奏效。
这该怎么做?非常感谢!