Dreamhost

Looking for somewhere to host your site? Browse our PHP web hosts section!

Home > Tutorials > Custom error pages using .htaccess

Custom error pages using .htaccess

Quick jump:
Introduction
Create the .htaccess file
Create the 404 error page
Trying it out
Taking it further

Trying it out

Now you need to see if it works. Type the URL of your website in your browser and add a random file name at the end. Something like "http://www.yoursite.com/dgsgdgsdgdsgg.htm".

If everything has worked properly, you should now be seeing your custom error message. If not, then it's possible your web host doesn't allow you to have your own .htaccess files. You may want to contact them and ask.

If it worked then you can now make a proper 404 page. You can have your own images, text, in fact anything else you can have in a normal web page. The best 404 pages have the site logo and a few simple lines explaining what's happened. If you have a site search, you could put that on it too in order to help visitors find what they're looking for.

Next page: Taking it further