METHOD ONE : IIS URL rewriting
Been working on further URL redirection relating to SEO optimizing to make some of the sites I manage better optimized for search engines. One of the thing I have to do it to redirect domain.com over to www.domain.com because if I don’t search engines might index the site two times and the might penalize me in the process..
My goal is to set a permanent 301 redirection and the tool I am going to try is URLRewrite 2.0 given that you are on Server 2008 R2 but to install you open Server Manager > Expand Roles and then click Web Server. In the main Web Server pane you scroll down to the Add Role Services and browse to HTTP Redirection (under Common HTTP Features)
Here is a direct link to URLRewrite 2.0 ( Thanks GIO)
I found out that I could either set the redirect separately on each website or globally and I that’s what I did so first I open IIS Manager and to go globally I double-clicked the URL Rewrite icon under Sites (Top Level)
Once opened click Add Rules and I choose to create Blank inbound rule and this screenshot basically descries my settings.
Now click OK and scroll down to Action and set it according to this image :
That´s it… really simple and there are a few ways to test (other then by using your browser)
Here is a fine test : http://www.seoconsultants.com/tools/headers
Type in URL : yourdomain.com and click Check Server Header
Your resaults should be simular to these
- User IP Address: xxx.xxx.xxx.xxx
- #1 Server Response: http://domain.com
HTTP Status Code: HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=UTF-8
Location: http://www.domain.com
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Mon, 07 Feb 2011 22:36:10 GMT
Content-Length: 145
Redirect Target: http://www.domain.com
Lappz