Gavin Barker 2 header image 2

Permanent 301 Redirect to new domain using IIS6

September 7th, 2007 · 7 Comments

I’ve recently had to move an ecommerce site from a .com domain to a Since the .com was well indexed by the search engines I wanted to use a 301 Permanent Redirect method. The site is hosted on Windows 2003 using IIS6 so I set about finding a solution. It turns out (although it is poorly documented) that you can set it up in IIS directly. Since I found it a struggle to maintain the querystring when redirecting, this is how to do it…

The following steps show how to move from to and retain your directories and querystring information. For example, will be redirected to with a 301 header telling the browser it is a permanent move.

  • Set up your new site at
  • Open the properties for your site in IIS
  • On the Home Directory tab for choose ‘A Redirection to a URL’
  • In the redirect to box enter$S$Q (note there is no slash after
  • Tick the ‘The Exact URL entered above’ and the ‘A permanent redirection for this resource‘ options.
  • Thats it

If you care about how it works, the $S tells IIS to take the subdirectory location and script e.g. /shop/product.asp and the $Q grabs the querystring. You might think it would make sense to not tick the ‘The Exact URL entered above‘ box, but if you do you get a very different result.

I hope that helps somebody, as it had me stuck for a while and the documentation isn’t very useful.

Tags: Work

7 responses so far ↓

  • 1 Klaus // Sep 12, 2007 at 12:32 pm

    Yeah, that is clear as glass to me…….maybe I will have a go at discovering a new galaxy this afternoon, it looks as though it may be easier!

  • 2 sandra // Nov 13, 2007 at 2:29 pm

    long time no blog !

  • 3 Silverfox // Dec 27, 2007 at 5:03 pm

    Get in touch with Brown, he is the WAFFLE king.

  • 4 Rob K // Jan 24, 2008 at 2:23 pm

    When I do the above I get a double ‘//’ on the end of the new url, any idea why?

  • 5 Gavin // Jan 24, 2008 at 4:36 pm

    @Rob K
    Not sure, did you make sure there were no slashes after the new domain? Here is a link to IIS variables

  • 6 Rob K // Jan 25, 2008 at 10:34 am

    It was odd, I wasn’t putting on any slashes and it was messing up all the query strings, so I unticked the ‘the exact url entered above’ and then re-ticked it and it was ok after that.

  • 7 WWE Wallpapers // May 16, 2008 at 9:11 am

    That really helped in setting up my website redirect. A friend referred this page and the info was great.

Leave a Comment