修改站点配置文件
默认
#PATH <Directory "/www/wwwroot/wurenji/public/"> SetOutputFilter DEFLATE Options FollowSymLinks AllowOverride All Require all granted DirectoryIndex index.php index.html index.htm default.php default.html default.htm </Directory>
修改为
#PATH <Directory "/www/wwwroot/wurenji/public/"> SetOutputFilter DEFLATE Options FollowSymLinks AllowOverride All Require all granted DirectoryIndex index.php index.html index.htm default.php default.html default.htm Order Deny,Allow # 禁用访问ip Deny From all # 允许访问ip Allow From xx.xx.xx.70/25 Allow From xx.xx.xx.xx # 报403错误时,重定向到/403.html地址 ErrorDocument 403 /403.html </Directory>
在访问目录新增错误提示html代码