Main | About | Services | Gallery | Contact | Blog
Breadcrumbs: main » news » 301 Redirects Using .htaccess to Improve SEO

301 Redirects Using .htaccess to Improve SEO

The following article was witten and published by William Szilveszter.

Skip to the break if you just came here to learn about 301 redirects. I frequently check my server logs, looking for problems with my site. But a constant worry are 404s. I belong to several bulletin boards and frequently upload content to a temporary storage repository found on my server. Themes, icons, graphical changes to popular programs and most of what I upload, I don’t often add to my website. Why? Because, quite frankly, I’m too lazy. I also don’t see much worth in packing my portfolio with titbits, or odds and ends. But every now and again, I do manage to put up content and not being one to leave duplicates on my server, pull it from the storage repository mentioned earlier. Sadly, this leaves the links on the boards orphaned. I do go in and try to modify the links, but I’d rather spend my time doing, you know, fun stuff. Yet my concern for my visitors (yes, I love you guys; group hug!) is always lurking, and I don’t want them to be greeted with the dreaded 404: Not Found. So I started to employ 301 permanent redirects.

First thing to do is pull up your .htaccess file (should be placed in the root directory of your website (e.g., /public_html/.htaccess). Open using your favourite text editor and add the following line:

redirect 301 old-url.html http://www.url.com/new-url.html

Where “old-url.html” is the outdated page or link (it can be any link, for example, /tmp/files/pictures.zip) and “http://www.url.com/new-url.html” is the new url. Note that should you have a link with a space in it (e.g., “old url.html”), you will need to place the url in quotations:

redirect 301 "old url.html" "http://www.url.com/new url.html"

It’s that easy. So dig through your logs and do your visitors a big favour. There is nothing more disheartening than jumping to a site, only to be greeted with disappointment!

This article was posted about 1 year ago, first appearing on Jul 08, 2009.
Name
Email (not made public)
Website (optional)

Comments are currently being held for moderation. If your comment does not appear immediately, please do not repost.