我已经设置了一个虚拟主机,如下所示
<VirtualHost *:80>
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Options Includes
AllowOverride All
</VirtualHost>
但总是把我抛在一边
AH00526: Syntax error on line 6 of /etc/apache2/sites-enabled/000-my-site.conf:
AllowOverride not allowed here
我有点困惑,因为我知道这是正确的地方
这是因为你必须把它放进去<Directory>
指示。' .htaccess 是每个目录上下文,因此您必须明确告诉 apache 哪里允许使用 .htaccess。
<VirtualHost *:80>
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Options Includes
<Directory "/var/www/html">
AllowOverride All
</Directory>
</VirtualHost>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)