如何风格404页面在WAMP服务器 [英] How to style 404 page in WAMP server

查看:161
本文介绍了如何风格404页面在WAMP服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用WAMP伺服器,我需要使用CSS更改404未找到网页样式。



解决方案

httpd.conf 文件中, ErrorDocument 部分:

 
#在三种口味:
#1)纯文本2)本地重定向3)外部重定向

#一些例子:
#ErrorDocument 500服务器做了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 文件。 p>

I am using a WAMP server and I need to change the "404 not found page" style using CSS. How can I do it?

解决方案

In your httpd.conf file, there will be an ErrorDocument section:

#
# 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
#

After that, add this code:

ErrorDocument 404 /error.html

That will set the error page to a file called error.html, and it is better than using .htaccess files.

这篇关于如何风格404页面在WAMP服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆