网址不符合 .htaccess 规则
我的网站中的某个网址有问题,它似乎不符合我的 .htaccess 规则。我遇到的问题如下。
我使用 url 访问我的网站: http://www.website.com/sitemap
我有以下 . htaccess 规则:
ReWriteEngine On
php_value include_path ".:/Webserver/blabla/boo"
RewriteCond %{REQUEST_URI} !^/cms[A-Za-z0-9\-_/]*$
ReWriteRule ^([A-Za-z0-9\-_/]*)$ /site/index.php/
ReWriteRule ^$ /site/index.php/
所以我希望这个 URL 调用重写到 /site/index.php,但重点是它永远不会去那里,而是打开位于 webroot 中的 sitemap.xml。它确实适用于我网站中的所有其他 URL。这里可能是什么情况?
I have a problem with one of the url's in my website , it doesn't seem to comply to my .htaccess rules. The problem I'm experiencing is the following.
I access my site using url: http://www.website.com/sitemap
I have the following .htaccess rules:
ReWriteEngine On
php_value include_path ".:/Webserver/blabla/boo"
RewriteCond %{REQUEST_URI} !^/cms[A-Za-z0-9\-_/]*$
ReWriteRule ^([A-Za-z0-9\-_/]*)$ /site/index.php/
ReWriteRule ^$ /site/index.php/
So I would expect this URL call to rewrite to /site/index.php but the point is it never goes there and instead opens sitemap.xml which is in the webroot. It does work for all other URL's in my site. What could be the case here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了罪魁祸首。这是由于 httpd.conf 和每个站点 .conf 文件中设置的 MultiViews 选项造成的。我在每个站点的 .conf 文件中禁用了 MultiViews 选项,将其设置为
-MultiViews
也许这个问题更适合 Serverfault。我可以转让吗?
I found the culprit. It was due to the MultiViews option set in httpd.conf and each individual site .conf file. I disabled the MultiViews option in the per site .conf file setting it to
-MultiViews
Maybe this question fits better in Serverfault. Is there a posibility for me to transfer it?