Not Redirecting Your Web Pages is Just Plain Rude

Have you ever visited a link from a website and ended up at an error page that let’s you know you’ve just wasted a few seconds of your life you’ll never get back? Whether it’s a 404 Error page or Missing Document page, a missing page is the black hole of the internet.

We’ve been updating many client websites and have come across missing pages a lot lately. By providing links to other web pages, your website can provide additional information for the visitor at the external resource. If these pages have moved or have been renamed, then they are worthless to the visitor if they haven’t been redirected to their new pages.

As an example, the IRS has a business section that was linked to from one of the websites we work on. If you try going to the linked page for small business information , then you’ll see that the requested page does not exist. You’d think with all that money, the IRS would be able to provide some proper redirection! The new page is here by the way: Small Business One-Stop Resource

Why you need to redirect your web pages

As a designer or webmaster, it’s your responsibility to redirect your old web pages to their appropriate new ones. Whether you have changed the file names to something more SEO friendly (See Poor Domain and File Naming), or have changed the extension from .html, .php or something else, you need to redirect all of your old pages to the new ones for the good of the web!

While not annoying the people that link to you is one reason to redirect, redirecting serves another important purpose. Search engine friendliness! Search engines “crawl” the web by going from link to link. If you are redesigning your website where all of your filenames change, then any and all “linkjuice” to your pages will be lost if not redirected properly. You’ll basically be starting from ground zero. Redirecting preserves the “stamp of approval” that your former web pages received. Not redirecting will have search engine spiders confused and will penalize your website for it through lost rankings.

How to do 301 Webpage redirects

Warning: Techy Mumbo Jumbo ahead

There are a number of ways to redirect your old web pages to new ones. More importantly the type of redirect you want to do is a 301 redirect, which tells search engines that the webpage has moved permanently. There are other types of redirects available for temporary purposes, but the ones discussed below are for permanent changes. All of these redirects depend on what is powering your website: Windows, Linux, and so on.

Redirecting through the .htaccess file

The most common redirect is through the .htaccess file on the root of your server. The .htaccess file is a directory level configuration file for Apache Servers. The example line of code below:

redirect 301 /old/page.htm http://www.shycon.com/my-new-page.php
  • redirect means it’s a redirect.
  • 301 means it’s permanent
  • /old/page.htm is the file name you are redirecting
  • http://www.shycon.com/my-new-page.php is the location of the new page.
  • You must use the same naming convention for these redirects to work! Your old file will not have you domain name attached to it, while your new file will!
  • Add additional lines for each and every page you want to redirect.

PHP redirect

PHP redirects are added to the actual file you want to redirect, not a central file. Adding this code to the old page will redirect it to the new one when a visitor goes to it.

< ?php
header(“HTTP/1.1 301 Moved Permanently”);
header(“Location: http://www.shycon.com/my-new-page.php”);
exit();
?>
  • Change the URL in the Location line to the correct page

Getting more complex…

The above examples are great for redirecting new sites with a manageable amount of pages. It’s a one-by-one approach. But what if you wanted to redirect thousands of pages? It really depends on your situation, but it should be manageable most of the time. It just takes more work than simple PHP and .htaccess redirects.

Further reading:

Tags: , , ,

Comments are closed.