我正在使用 cpanel/whm 设置。
htaccess 文件在基本目录 (public_html) 中工作正常,但低于该目录 (public_html/stuff/) 的任何内容都不会被处理。我知道我需要设置AllowOverride,但是我到底在哪里启用它?
最佳答案
AllowOverride 指令是在 apache 全局配置文件中设置的。该文件由 cPanel 管理,重要的是不要编辑未标记为 edis 的部分,因为这些编辑将会丢失。
配置文件位于:/usr/local/apache/conf/httpd.conf
您正在寻找如下所示的部分,因为AllowOverride指令仅在配置文件的
<Directory "/">
Options All
AllowOverride All
</Directory>
确保在 apache 配置中启用此 AllowOverride 后,您需要通过运行以下命令让 cPAnel 知道您已更新该文件:
/usr/local/cpanel/bin/apache_conf_distiller --update
有关AllowOverride指令的更多信息:
cPanel 日志和配置海报:
关于apache htaccess 位于带有 cpanel/whm 的子目录中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19213220/