Home > Blogs, Bookmarks, Hosting, PhP, Web > Custom 404 Error Page with htaccess

Custom 404 Error Page with htaccess

November 18th, 2007 Leave a comment Go to comments

Add the following line to the .htaccess file

ErrorDocument 404 /errors/404.php

ex .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
ErrorDocument 404 /errors/404.php
</IfModule>

Upload 404.php file to /errors/ folder.

404.php can redirect to homepage, ex:
Redirection url with META Refresh:

<html>
<head>
<meta http-equiv=”refresh” content=”0;url=http://www.new-url.com“>
</head>
<body>
This page has moved to <a ref=”http://www.new-url.com“>http://www.new-url.com</a>
</body>
</html>

  1. November 13th, 2009 at 08:09 | #1

    It was rather interesting for me to read the post. Thank you for it. I like such themes and anything connected to this matter. I definitely want to read more on that blog soon.

  1. July 2nd, 2008 at 02:10 | #1
GoCache - ByREV-Cache v1.0 - live served in : 0.145097 sec (gzip)