Sales and Marketing Technologies
Search
Do you want Breakthrough Results? Let us help you.Questions? Call 1.888.670.6905
Custom Web Development E-commerce Solutions Web Consulting Web Maintenance Web Hosting CMS Solutions
Internet Marketing Consulting Local Search Marketing Pay Per Click Management Reputation Management SEO Services Social Networking Video SEO (VSEO)
Miami Children's Hospital Reflectx Services Dinnerware Depot U.S. Home Filter
What We Offer Altamonte Springs Office Orlando Office Tampa Office
Internet Marketing Blog Contact Us Refer a Client Employment
Blog

Implementing 301 Redirects on Legacy URLs

Wednesday, March 04, 2009

The implementation of 301 redirects for legacy URLs is a crucial step in website redevelopment and URL optimization projects. It seems that web development companies that are not strong in Internet Marketing often make the mistake, out of ignorance more than anything, of not properly taking care of legacy URLs, that is of URLs that used to rank on the previous website version but whose content has been assigned a new URL. For example if the details page of a product is now on http://www.domain.com/Products/CategoryX/ProductY.html the legacy URL prior to the website redevelopment or URL optimization could have been http://www.domain.com/product.asp?productCategory=CategoryX&productName=ProductY

What would happen if Google continued to send traffic to the legacy URL? The worst outcome would be a dreadful 404 error message back from the server. That product page, which used to rank for Google, now only provides your visitors with a sad “Page Not Found” message. If you are seeking to preserve some of your rankings after the launch of your new site version, a 404 error is unacceptable. We have seen in the past that web development companies will at least gracefully handle a 404 by redirecting the user to the home page. Your old rankings will likely still quickly dwindle, but at least you are not faced with the user experience disaster of a 404.

We come now to what should be done to properly address legacy URLs. The answer is simple. Create URL Rewriting rules to instruct your server to return 301 messages instead of 404 messages for those URLs. A 301 is a “Permanent Redirect” message that conveniently provides a new URL and instructs your visitor’s web browser to go there instead.

But you have dozens, hundreds, even thousands of products. It sounds a little crazy to produce rewrite rules for all URLs, and in fact it is crazy. In many cases you don’t have to. That’s what the rewrite engine and regular expressions are for.

Assuming that you use ISAPI Rewrite 2 using the example above you can accomplish all of your product detail redirects with one rule:

RewriteRule /product.asp\?productCategory=(.*)&productName=(.*)    /Products/$1/$2\.html [I,RP,L]

In the first half of the rule each parenthesis block creates a back-referenced subexpression. Two back-referenced subexpressions are created, one after the productCategory equal sign and one after the productName equal sign. These subexpressions are then “back-referenced” on the second half of the rule as $1 and $2 respectively and so this rule tells the server:

  1. If there is a request for anything in the format /product.asp?productCategory=[Back Reference Subexpression #1]&productName=[Back Reference Subexpression #2]
  2. Apply this rule in “case insensitive” mode so it does not matter what was lower case or uppercase in the requested URL (thus the “I” flag at the end of the rule to indicate Case “Insensitive”)
  3. Produce a permanent redirect (thus the RP flag at the end of the rule to indicate to “Redirect Permanently”) and tell the visitor’s browser to go to /Products/[Back Reference Subexpression #1]/[Back Reference Subexpression #2].html instead
  4. If there was a match, make this the “last” rule that applies and do not continue down the rules file looking for other rules (thus the L flag at the end of the rule to indicate that this is the “Last” rule)

This will also tell the search engine spiders that a page has been permanently redirected and eventually it will know that the page that used to be located at the legacy URL now has a new URL.

301 Redirects for Legacy URLs should not be an eleventh hour implementation process. To be effective it needs to be properly thought out at the beginning of a redevelopment or URL optimization project. The example above assumes a best case scenario where your legacy URL contain all of the information that your new URL needs. I will discuss conditional expressions and rule loops in a future post to address more complex scenarios.

David Ajoy 3/4/2009 8:53:00 AM

Comments:

Response to: Implementing 301 Redirects on Legacy URLs
Wednesday, March 04, 2009
Brent says:

You're giving away all your secrets!

Add your comments:

Items in bold indicate required information.

Name :
 
Email :
 
Comments :
 
Latest Posts

Categories
Blogging (2)
Website Design (4)
Website Functionality (3)
Internet Marketing (82)
Company News (6)
Email Marketing (7)
General Marketing (11)
Google Android (2)
Local Search (10)
Mobile Search (1)
Offline Marketing (2)
PPC (11)
RSS (5)
Search Engine Optimization (30)
Social Media (5)
Social Networking (13)
General Programming (2)
SQL Programming (2)
Video Search Engine Optimization (3)

Archives

Blogroll
Yahoo!
Google
Technorati Profile

Feeds
Newsletter Signup
Enter your email address below and receive special offers.
From Our Customers
SMT has been our website and digital marketing partner for several years. They have been enormously helpful in optimizing our website, keeping us ranked high with the major search engines and have efficiently managed our PPC efforts. We recommend them highly to anyone looking for ways to maximize their web presence.

Jack W. Wert, FCDME Executive Director Collier County Convention and Visitors Bureau
Our Work    |    Web Development    |    Internet Marketing    |    Case Studies    |    FAQ    |    About SMT    |    Press Room
Employment    |    Refer a Client    |    Contact Us    |    Internet Marketing Blog    |    Privacy Policy    |    Site Map

Sales & Marketing Technologies
Altamonte Springs: 220 E. Central Parkway, Suite 1010 • Altamonte Springs, FL 32701407-792-4848
Orlando: 301 E. Pine Street, Suite 150 • Orlando, FL 32801407-792-1951
Tampa: 4511 N. Himes Avenue, Suite 200 • Tampa, FL 33614813-448-3550

© 2010, Sales & Marketing Technologies, Ltd. All rights reserved.
Website Design FL & Search Engine Optimization Services