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.

I soon will be purchasing a virtual windows server and will be using IIS7

I’m keen for SEO purposes to 301 redirect any users from mydomain.co.uk to www.mydomain.co.uk, but as I have root access to my server I would like to use IIS7 rather than modifying my application

can anyone explain how this is done ?

thanks

Trueglly :)

share|improve this question

3 Answers 3

up vote 1 down vote accepted

In IIS Manager, select (Server) -> Sites -> (Site name), click ‘Bindings’ in the Actions pane, and Edit the binding so the real site responds only to the host name www.mydomain.co.uk.

Now create a second site (Sites -> Add Web Site...) bound to mydomain.co.uk and any other hostnames you want to send to www. Select the new site and double-click the ‘HTTP Redirect’ feature. Enable ‘Redirect requests to this destination:’ and point it to http://www.mydomain.co.uk/. For SEO purposes, set the ‘Status code’ to 301.

share|improve this answer

Go to IIS Manager and click on the Sites->sitename you want to redirect. If the HTTP Redirect Role Service is enabled then you should see the HTTP Redirect icon in the Home panel.

If it's not there then you need to load it. Start Server Manager and go to Roles->Web Server (IIS)->Role Services -> Add Role Services and install HTTP Redirection.

Your IIS Server Manager Sites>sitename home panels shoulds now have the HTTP redirect module available.

share|improve this answer
    
hello, thanks for the response, ive tried this but i keep getting this error in FF - Firefox has detected that the server is redirecting the request for this address in a way that will never complete. i have entered - mydomain.dev (.dev is my local dev copy), and selected 301. i have also tried www.mydomain.dev/ but that just repeats the URL until this error is set - The length of the URL for this request exceeds the configured maxUrlLength value. any ideas ? –  Truegilly May 8 '10 at 12:17
    
When I did this it worked as expected. Can you access the www.mydomain.co.uk site before you start redirecting from mydomain.co.uk ? If not then get it working and then try the redirection. –  Iain May 8 '10 at 18:05

You can look at http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ its very easy with that module

share|improve this answer

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.