【发布时间】:2011-10-11 00:16:44
【问题描述】:
我想让我的 .htaccess 文件重写 index.php 文件中不存在的任何内容。例如:www.example.com/category/subcategory/product1/ 将被重写为 index.php?request=category/subcategory/product1
我想先检查目录是否存在,如果存在,不要重写。我现在有这样的东西,但只需要知道如何将请求的 URL 放入 PHP $_GET 变量中:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) /index.php [L]
感谢任何帮助!
【问题讨论】:
标签: .htaccess mod-rewrite