PDA

View Full Version : Implementing 301 redirects and URL rewriting


Fernando
05-11-2006, 09:27 PM
Hello everyone,

I am getting ready to correct problems caused by a poorly implemented rewrite system (problems discussed at http://forums.searchenginewatch.com/showthread.php?p=69850)

Before we started coding, I wanted to get some comments to avoid yet more poorly implemented features. This should also be useful to others that are planning on implementing a rewrite/redirect system to help their SERPs.

We are not trying to trick SE’s or do anything shady. We are simply trying to present our information in the best format possible for search engines without sacrificing human usability. As I’ve read on other posts, some will advise that this is overkill and that we should just focus on having great content and the rest will take care of itself. We’ve tried that and it hasn’t worked for us.


The goals:

1) Create a CMS that makes site maintenance easy and scalable but is also SE friendly.

2) Get PR credit from existing incoming links—most of which have dynamic data such as affiliate ID’s, marketing campaign ID’s, etc.

3) Eliminate duplicate content issues by ensuring content always appears as one unique URL.


The technology:

We need to be able to pass information that comes in via URL parameters to another page without using any URL parameters. To do this, the first page reads in the URL parameters, then transfers those parameters into a cookie, then redirects the browser to the URL-parameter-less page which then reads the cookie to get the information it used to get from the URL parameters. Parameters are needed for such things as giving credit to a particular affiliate, showing a particular flavor or size of a product, deciding what promotional info to show alongside the standard content, etc.

Technically, this works. We have tested it and have been able to pass info from page to page without the use of URL parameters.

Does anyone see any problem with this method?

Most SE’s don’t use cookies so they’ll see the standard, default page. And if they do use cookies, they’ll still see the same page but perhaps with some customizations depending on what the cookie info is. Human browsers that accept cookies should still have all the functionality that is currently available via the URL parameter method. And human browsers that don’t accept cookies will have problems, but that group can’t place orders on our site now anyway so we won’t be loosing additional prospects.


The plan:

1) Any URL that calls the home page gets rewritten to http://www.allstarhealth.com. Examples: http://allstarhealth.com, http://allstarhealth.com/home.aspx, http://allstarhealth.com?ref=ABCD

2) Any URL that causes the server to show the information for a particular product gets re-written to the standard URL assigned to that product. For example, “blah.com/prod.aspx?prodid=123”, “blah.com/prodid123.htm”, “blah.com/prod.aspx?prodid=123&size=L”, “blah.com/prod.aspx?prodid=123&campaignID=456”, all get redirected to “www.blah.com/p/Centrum-Complete.htm”

3) Any URL that causes the server to show a list of products that match certain standard categories, gets rewritten to the standard URL assigned to that category. For example, “blah.com/list.aspx?k=creatine”, “blah.com/list.aspx?k=misspelledcreatine&campaign=123”, etc., get redirected to “www.blah.com/c/creatine.htm”.

4) All other URLs that have any parameters in them get redirected to the same filename but with all the parameters stripped off the URL and placed in a cookie.


The questions:

1) Is it known if search engines frown upon a lot of 301 redirecting? There will be a lot of redirecting going on but I haven’t found any posts that suggest this would be a problem.

2) How much do search engines deduct for pages that are in a subdirectory vs. the root directory? To avoid potential conflicts, I’d like to have all products show up in a /p/ subdir (such as http://www.allstarhealth.com/p/someproduct.htm), all categories show up in a /c/ subdir, etc. I could take out that subdirectory, but then the potential exists for a product name and category that have the same apparent URL.

Marcia
05-11-2006, 11:01 PM
One subdirectory in isn't a problem. Even with Google, it's the number of clicks in from the homepage and to a degree the PR distribution and internal linking structure for crawling.

Just to be clear, you've got .aspx pages so you need a .net/IIS solution rather than Apache mod_rewrite, right?

Fernando
05-11-2006, 11:34 PM
Correct. It's .net. We are using the built in function much like the one described in this post:

http://forums.searchenginewatch.com/showpost.php?p=79710&postcount=4

pleeker
05-12-2006, 04:49 AM
1) Is it known if search engines frown upon a lot of 301 redirecting? There will be a lot of redirecting going on but I haven’t found any posts that suggest this would be a problem.I've also never seen anything to indicate that even a substantial amount of 301 redirecting is frowned upon. The 301 is recommended by the SEs, and they're smart enough to know that large sites are bound to need to use the 301 heavily to avoid duplicate content issues.

seoanalyst
05-13-2006, 05:09 AM
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently" Response.AddHeader "Location", " http://www.new-url.com"
>