.htaccess 对所有内容都给出递归错误
我正在尝试通过index.php 重定向所有流量。
这是我的 .htaccess 文件:
RewriteEngine On
RewriteRule ^(.*)$ /index.php?ref=$1 [NC,L]
我总是收到 HTTP 500 错误,我检查 error.log,发现它是内部递归错误。谁能帮我解决这个问题吗?谢谢。
I am trying to redirect all traffic through index.php.
Here is my .htaccess file:
RewriteEngine On
RewriteRule ^(.*)$ /index.php?ref=$1 [NC,L]
I'm always getting HTTP 500 errors, and I check the error.log and I see that its the internal recursion error. Can anyone help me with this? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不完全确定这是否是执行此操作的规范方法,但添加这样的条件将起作用:(
添加任何查询字符串的 QSA。)
但是,我建议使用附加方法
来防止通过索引发送静态资源。 php(除非那确实是您想要的。)
Not entirely sure whether this is the canonical way to do this, but adding a condition like this will work:
(The QSA to add any query strings.)
However, I would recommend an additional
to prevent static resources from being sent through your index.php (unless that is really what you want.)