Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to style 404 page in WAMP server

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

enter image description here

like image 967
Rav Avatar asked Aug 01 '12 06:08

Rav


2 Answers

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.

like image 136
uınbɐɥs Avatar answered Sep 27 '22 19:09

uınbɐɥs


This is a core feature in Apache, and you can select a few methods of changing the 404 message.

To create your own custom page with HTML/CSS, this is one option you can put in your .htaccess file:

ErrorDocument 404 /my404.php
like image 29
Cody MacPixelface Avatar answered Sep 27 '22 19:09

Cody MacPixelface