Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a number of URLs that need to be rewritten for SEO purposes, and the list is getting quite long.

I would like to know about good URL rewrite strategies so that we can keep the old URLs, but 301 redirect them to SEO friendlier URLs. What are the performance implications of the URL rewriting system you employ?

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

If you have admin access to the server, you could use ISAPI_Rewrite. This is an ISAPI filter that you setup in the IIS6 configuration. There is a paid and free version - I have only used the free version though.

I have used it on a couple of sites to do what you want and I cannot see any performance issues with it (though I have not formally tested).

To set up the redirects, you would add an entry for each of the redirected URLs into the ISAPI_Rewrite .ini file. The syntax is a lot like mod_rewrite for Apache - but not exactly the same.

Examples from the ISAPI_Rewrite site:

# Translate my-super.product.html to /Product.aspx?ProductID=123
RewriteRule ^/my-super-product\.html$ /Product.aspx?ProductID=123

# Rewrite numeric URLs
RewriteRule ^/Products/P([0-9]+)\.html$ /Product.aspx?ProductID=$1 [L]

You should consult the documentation for more thorough use-cases.

share|improve this answer
add comment

IIRF works, implemented as an ISAPI filter in C, very fast. FREE. Can do 301 redirects as well as rewrites. (sometimes both, for the same URL).

It includes an installer, and CHM doc:

alt text

share|improve this answer
add comment

Although we're using Apache instead of IIS, we had similar performance worries about large numbers of redirects. We implemented the following system:

Any pages that need to be redirected would normally generate a 404 Not Found error since they no longer exist, so we only process rewrites on 404's. This means we don't have any performance penalty for regular requests.

Once a page generates a 404, we pass the request to our 404 controller, which checks a (cached) db table and renders a redirect header to the browser. If no matching page is found we render the regular 404 page.

Since redirects are stored in a table we can integrate them into our cms, e.g. providing an option to manage all redirects to a page from the page's properties. Or automatically checking for redirects which point to non-existing pages.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.