简体   繁体   English

没有规则的Apache2重写

[英]Apache2 rewriting without rules

So i've a Wordpress site on my domain and i want to add subdomains with their own php code. 所以我在我的域上有一个Wordpress网站,我想用自己的php代码添加子域。 I'm using mod_rewrite for wordpress and want to use it for my own projects but weirdly i can access urls that should result in a 404 error. 我对wordpress使用mod_rewrite,并想将其用于我自己的项目,但是很奇怪,我可以访问应该导致404错误的网址。 For example i can access test/somestuff/morestuff and get test.php (without any $_GET set). 例如,我可以访问test / somestuff / morestuff并获取test.php(不设置任何$ _GET)。 But i have no .htaccess file in the directories for the virtual hosts. 但是我在虚拟主机的目录中没有.htaccess文件。 I then tried to delete the .htaccess from wordpress, restart apache2, and try again but i get the same behavior on the virtual host and wordpress doesn't work with permalinks (like i thought it would). 然后,我尝试从wordpress中删除.htaccess,重新启动apache2,然后重试,但是我在虚拟主机上得到了相同的行为,wordpress无法使用永久链接(就像我认为的那样)。 My sites-available configs don't have any rewrite rules in them. 我的网站可用的配置中没有任何重写规则。 Why can i access URLs that shouldn't work? 为什么我可以访问不应该使用的网址? Am i missing some feature of apache? 我是否缺少Apache的某些功能?

So after some more trying i've discovered the error was that i've had MultiViews enabled for the virtual host. 因此,经过更多尝试后,我发现错误是我为虚拟主机启用了MultiViews。 I've disabled it and now it works. 我已禁用它,现在它可以工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM