Apache mod_rewrite 规则未从 .htaccess 文件处理
任何人都可以帮助解决 apache2 中的覆盖问题吗?
我已经在apache2中启用了mod_rewrite。
但 apache 只是忽略我的 .htaccess 文件的重写规则。
这是我的虚拟主机配置:
<VirtualHost *:80>
ServerName www.modomain.eu
ServerAlias mydomain.eu *.mydomain.eu mydomain.es *.mydomain.es
DocumentRoot /home/sites/mydomain.es
<Directory /home/sites/mydomain.es>
AllowOverride None
</Directory>
</VirtualHost>
Can anyone help to solve problem with overriding in apache2?
I have enabled mod_rewrite in apache2.
But apache is just ignoring my .htaccess file's rewrite rules.
This is my virtual host configuration:
<VirtualHost *:80>
ServerName www.modomain.eu
ServerAlias mydomain.eu *.mydomain.eu mydomain.es *.mydomain.es
DocumentRoot /home/sites/mydomain.es
<Directory /home/sites/mydomain.es>
AllowOverride None
</Directory>
</VirtualHost>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您将AllowOverride 设置为“none”,则不会处理.htaccess 文件。如果将其设置为“allowoverride all”,它应该允许您覆盖虚拟主机配置文件中的设置。
.htaccess files aren't processed if you have AllowOverride set to "none". If you set it to "allowoverride all" it should allow you to override the settings in your vhost configuration file.
请阅读此处,例如:
Read here e.g.:
设置以下内容:
在
节中这将允许 .htaccess 文件能够覆盖各种设置(例如重写规则)
Set the following:
In the
<Directory>
stanzaThis will allow the .htaccess file to be able to override various settings (such as rewrite rules)