Apache服务器上设置404错误页面

Apache服务器上设置404错误页面

基于ubuntu 16.04系统,使用 apache 进行设置

配置步骤

  • 添加404页面
在所配置网站的根目录添加编辑好的 404.html
  • 修改localized-error-pages.conf配置文件
localized-error-pages.conf位于 /etc/apache2/conf-enabled目录下
把#ErrorDocument 404 /404.html 去掉#
  • 重启 apache 服务器
/etc/init.d/apache2 restart #重启

相关推荐