Today, a significant number of web users will seek a website by just typing in the domain name without the 'http://' and without the 'www.' The following links all point to the same web page:
This is convenient for the user, but from a Search Engine Optimization standpoint, the first 3 links are equivalent, but unless you setup a permanent redirect (301), this last link without the www is treated as a separate website to the search engines. Search engines will think that you have duplicate content on the web and under its discretion, select one as the default and discount the other as duplicate content.
In the UNIX world, you modify the HTA file, but in the Windows world with IIS 7, you need to download and install the URL Rewrite module for IIS 7.
Download this install package and install it on your web server (Note: this does not require a server reboot and it does not reset IIS, you can run it on-the-fly on your production web server). The install only asks you to accept the terms, then it installs. If you go into IIS7 after this install and navigate to a website, you will see a button for URL Rewrite in the IIS section of the website configuration.
The easiest way to implement thati is to modify the web.config file for each website. Open your web.config file in Notepad, search for clause and put the following code just above the clause:
<configuration> <system.webServer> <rewrite> <rules> <rule name="Redirect to WWW" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^YourDomain.com$" /> </conditions> <action type="Redirect" url="http://www.YourDomain.com/{R:0}" redirectType="Permanent" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
Change the two references to 'YourDomain' with your actual domain name. For example:
<configuration> <system.webServer> <rewrite> <rules> <rule name="Redirect to WWW" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^Microsoft.com$" /> </conditions> <action type="Redirect" url="http://www.Microsoft.com/{R:0}" redirectType="Permanent" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
If you search for your domain without the www (ex. rwinsphoto.com), then if the rewrite is correct, the webpage that is displayed is http://www.rwinsphoto.com/home.aspx
Simple but effective!
RadEditor - please enable JavaScript to use the rich text editor.
I often get asked why I'm willing to journal all of my Sitefinity discoveries. People think I'm insane to give away for free what I labored over at some point.
Let me answer that in 2 parts:
Talk to us about how we can help YOU!
Keep up with our Sitefinity discoveries! Click on the RSS feed icon below or sign up for our newsletter.