Custom Error Pages with .htaccess



Ok, we’ve looked at controlling access to directories with .htaccess, but there are other neat tricks we can do that can add a bit of polish to your site.

One that I’ve implemented lately is a custom error page. Now, we’ve all done this, clicked on a link and get a page that says Error 404 page not found. This is the standard code for “it’s not here anymore.” I noticed at one point I was getting a LOT of 404 errors looking for files that had simply moved, so I did the following.

I created a page that looked like the main theme on the website and named it error.html (I might move it to error404.html soon.) The main contents of the page say the page you tried to access is no longer there it may have been renamed or moved, it gives links to either this site, or the North Carolina Genealogy site which is hosted on the same machine. After 10-15 seconds I’ve done a redirect to the North Carolina Genealogy site since most of the 404 errors were for pages related to that site.

If you’re curious on how to setup a page that refreshes/redirects take a look at Creating a Redirect Page

Related Posts

Blog Traffic Exchange Related Posts
  • Creating a redirect page This is one that comes in handy a lot. Like many things in computing there are a number of ways to accomplish this. My favorite though is one fo the simplest. But first, it's probably worth asking why you would want a redirect page and just clarify what I mean.......
  • Page banned from Google? So for the past month and a half I've been puzzling over northcarolinagenealogy.net and it's mysterious sudden disappearance from google. I mean... let's see, there are a couple hundred posts there. It uses the same template as this and the South Carolina genealogy site do. Nothing really different than the......
  • Evolution email error MAIL FROM command failed: Unknown Some time back, I was teetering on the brink.... I've used Evolution as my linux mail client for ages (since I switched), because it had the calender integrated etc... However, Kontact has REALLY looked nice for some time, but I didn't have time to mess with changing. Then one day,......
Blog Traffic Exchange Related Websites
  • Outlining The Main Contrasts Between UK And US Web Hosting Website marketing is the current trend of modern business. It seeks to exploit online resources to reach out to the public. Websites are used to educate and relay specific information to internet surfers. The process of developing sites is a long one and requires a lot of planning and expertise.......
  • A Guide To Picking A Website Hosting Service Website hosting services allow individuals and organisations to make their own website accessible to the world web, by using space on a server either owned or leased by them, for the clients use. With internet connectivity as a data centre, they are also able to provide data centre space for......
  • Free Vs Paid Web Hosting Options Everyone likes to get something for free. But as the existence of spam shows, free isn't always good. Sometimes, it's downright harmful. Deciding whether it's worth the cost to pay for hosting involves a number of complex considerations.Hosting companies that offer free services obviously can't stay in business from the......
PDF24    Send article as PDF   

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

Comments are closed.


Switch to our mobile site