十一黄金周期间,手下管理的一个网站空间租用准备过期了,确定以后不需要绑定子域名,于是把网站由原来的windows2003系统转移到linux系统,这原因也出于费用的精打细算,因为同样的空间,linux比window便宜多了。
网站的整过转移过程十分顺利,除了404错误页面设置有异于windows系统外。那么在linux系统下如何设置自定义404错误页呢?
下面将分两个步骤实现
一、在网站的根目录下查看是否有.htaccess 文件,如果没有则自建一个。在.htaccess 文件中加入如下语句:
ErrorDocument 404 /404.html
二、在网站根目录下建立一个 404.html 文件,文件的后缀需要和.htaccess中指定的文件一致。
完成上面的步骤后,在地址栏输入该网站的一个不存在的页面进行测试,如果打开页面是你自定义的那个404.html,说明自定义404错误页成功。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools