apache用.htaccess设置HTTP错误

九 10 2009 Published by Code-k under 技术讨论

如果你使用的是apache主机,
那么可以通过.htaccess文件来自定义你的HTTP错误页。
如果你的网站根目录下有.htaccess文件,
请在以下字段后加入:ErrorDocument 404 /http404.html

RewriteEngine on
#RewriteBase /


如果你的网站根目录下没有.htaccess文件,
清新建一个文本,
直接添加:
ErrorDocument 404 /http404.html
上传到根目录即可。

ErrorDocument 404 /http404.html代码段中,
404是错误类型,可以自行根据需要修改,
http404.html是错误页面路径,
如果没有错误页面,
请自行制作或请他人制作。

No responses yet