(828) 862-6667

Sitefinity Blogs


  • Little known Sitefinity configuration settings
  • More detailed examples for Sitefinity component usage
  • Work-arounds for Sitefinity limitations
  • Discoveries and Ah-Ha moments 

Canonical Redirect using IIS 7.0

by Rich Winslow | Nov 02, 2010

The Problem

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.

The Solution

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.

The Windows Solution

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>
Save the web.config file and you are done.

The Result

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!

2 Comments

  1. 1 jordan sneakers 26 Apr
    to return to jordan retro 6 oreo Japan, want to jordans 8 go home. air jordan retro 17 He was jordan 3 true blue 2011 an interview with reporters, but suffer no jordan shoes 18 one can fully. air jordan retro 7
  2. 2 jordan sneakers 26 Apr
     <b><a href="http://www.christianlouboutinpumpsshop.org/">christian louboutin sale</a></b> Chinese, Japanese have been almost forgotten.  <b><a href="http://www.uslouboutinshoesonline.com/">christian louboutin shoes</a></b> Japanese relief stations have  <b><a href="http://www.uslouboutinshoesonline.com/">cheap christian louboutin</a></b> been invited to be volunteers,  <b><a href="http://www.christianlouboutinpumpsshop.org/">louboutin pumps</a></b> but  <b><a href="http://www.uslouboutinshoesonline.com/">christian louboutin online</a></b> still  <b><a href="http://www.christianlouboutinpumpsshop.org/">christian louboutin black pumps</a></b> can not communicate.

Comment

  1.    
     
     
      
       

Why Give Our Secrets Away?

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:

  • Why journal my discoveries?

    Because I forget and I want to a library of knowledge to refer back to. Oh but it is far worse than that... THREE TIMES now, I've gone to Google and searched for a solution to a problem, only to find MY OWN BLOG entry is #1 in Google and viola! there's the solution!
  • Why give it away for free?

    Because others have been kind enough to do it for us; what goes around, comes around.

    There are all levels of experience, thus someone with less experience may defer to us when needed.

    The lines of 'competition' are very much blurred; in our minds competition is a potential customer or partnership in the right situation.

    We maintain healthy partnerships with one of our competitors; they come to us when they need help and visa versa.

    There is plenty of work out there for everyone if you are putting out quality work and you are straightforward with clients and competition.

Talk to us about how we can help YOU!

 


Don't miss out!

Keep up with our Sitefinity discoveries!
Click on the RSS feed icon below or sign up for our newsletter.


Email Address:
     















Company Info  |   Contact Us  |   Site Map  |   Terms  |   Privacy Policy  |  

Automated Results Computer Consulting LLC, 222 South Caldwell Street, Brevard, NC 28712 (828) 862-6667