为什么这个 RewriteRule 被破坏了?
好吧,伙计们,我很茫然。
RewriteCond %{HTTP_HOST} ^domain.nl$
RewriteRule ^(.*)$ poker/$1 [L]
向我抛出 500 错误。如果我删除重定向并手动转到 /poker/ ,它就可以工作。如果我使用这个:
RewriteCond %{HTTP_HOST} ^domain.nl$
RewriteRule ^$ poker/ [L]
显示首页(但不显示 css,因为显然 / 之后的任何内容都不会重定向。
什么可能导致此 (.*)
中断?
在此规则之前就是这样删除 www:
RewriteCond %{HTTP_HOST} ^www\.([a-z-]+)\.([a-z]{2,3})
RewriteRule ^(.*)$ http://%1.%2/$1 [R=301,L]
之后就没有什么可以干扰的了。
Ok folks, I'm at a loss.
RewriteCond %{HTTP_HOST} ^domain.nl$
RewriteRule ^(.*)$ poker/$1 [L]
Throws me a 500 error. If I remove the redirect and go to /poker/ manually it works. If I use this:
RewriteCond %{HTTP_HOST} ^domain.nl$
RewriteRule ^$ poker/ [L]
The front page is shown (but the css not, because obviously anything after the / is not redirected.
What could cause this (.*)
to break?
Before this rule is just this to remove www:
RewriteCond %{HTTP_HOST} ^www\.([a-z-]+)\.([a-z]{2,3})
RewriteRule ^(.*)$ http://%1.%2/$1 [R=301,L]
After it is nothing that could interfere.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
太容易了。
给出无限循环。我只需要添加:(
或者正如我刚刚发现的那样,在 /poker/ 目录中仅使用
RewriteEngine On
创建一个空的 .htaccess 也可以达到目的)。It was so easy.
Gives an infinite loop. I just had to add:
(or as I just found out, creating an empty .htaccess with just
RewriteEngine On
in the /poker/ dir did the trick as well).