加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

php – 如何在WAMP服务器中设置404页面样式

发布时间:2020-12-14 23:17:53 所属栏目:资源 来源:网络整理
导读:我正在使用WAMP服务器,我需要使用CSS更改“404 not found page”样式.我该怎么做? 最佳答案 在你的httpd.conf文件中,会有一个ErrorDocument部分: ## Customizable error responses come in three flavors:# 1) plain text 2) local redirects 3) external

我正在使用WAMP服务器,我需要使用CSS更改“404 not found page”样式.我该怎么做?

最佳答案
在你的httpd.conf文件中,会有一个ErrorDocument部分:

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

之后,添加以下代码:

ErrorDocument 404 /error.html

这会将错误页面设置为名为error.html的文件,并且比使用.htaccess文件更好.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读