我有一个类似的设置。我想把所有的请求都发送给index.php给index.php。因此,任何到/reroute/products的内容都会转到/reroute/index.php,并将显示给浏览器。这看起来很简单,但我尝试过的每一件事要么告诉我文件不存在,要么把我循环起来。
另外,是否可以在重路由之前设置自定义标头?
Options +FollowSymLinks
IndexIgnore */*
# Turn on the RewriteEngine
RewriteEngine On
RewriteCond %{IS_SUBREQ} false
RewriteRule ^/index\.php$ http://www.example.com/reroute [R=301,L]发布于 2010-01-05 23:43:18
试试这条规则:
RewriteRule !^index\.php$ index.php [L]这将重写所有不请求index.php的请求到同一个目录中的index.php。
发布于 2010-01-05 23:45:36
我就是这样做的。
RewriteRule ^/reroute/products/$ reroute/index.html [QSA,L]它将几乎所有的东西都发送到索引文件中。
https://stackoverflow.com/questions/2009982
复制相似问题