AllowOverride All
通常情况下,Apache是默认启用.htaccess的,但是为了以防万一,请检查一下自己站点的配置文件,如httpd.conf,是否有这行:
AllowOverride All
这行允许重写配置文件。也就是如果能够从.htaccess加载配置文件,那么就以.htaccess为配置文件对其所在目录进行配置。
启用目录浏览
# enable directory browsing
Options All +Indexes
禁用目录浏览
# disable directory browsing
Options All -Indexes
配置错误页面
# custom error documents
ErrorDocument 401 /err/401.php
ErrorDocument 403 /err/403.php
ErrorDocument 404 /err/404.php
ErrorDocument 500 /err/500.php
最后于 2020-10-24
被admin编辑
,原因: