non www to www redirecting problem in iis - a little urgent

Posted on 2012-09-07
Last Modified: 2012-09-14
Hi there;

I have a website named as implemented in ASP.NET and under IIS 7.5

I need to redirect to but after adding the rule to configuration file, it simply fails with the following error:

Line 63:             ASP.NET to identify an incoming user.
Line 64:         -->
Line 65:     <authentication mode="Windows" />    
Line 66:     <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
Line 67:   </system.web>

The partial web.config file content is as follows:

                        <rule name="Add WWW prefix" >
                              <match url="(.*)" ignoreCase="true" />
                                    <add input="{HTTP_HOST}" pattern="^aftonblatte\.se" />
                              <action type="Redirect" url="{R:1}"
                                    redirectType="Permanent" />
                        <clear />
                        <!--remove upon opening the site-->
                        <!--<add value="Home.aspx" />-->
                        <!--<add value="Default.aspx" />-->
                        <add value="index.html" />
            <validation validateIntegratedModeConfiguration="false" />        
        <directoryBrowse enabled="false" />

Can you help me?

Question by:jazzIIIlove
    LVL 6

    Accepted Solution

    I would use a 301 Redirect as it will be better for search engine optimization.
    Here is a link that explains it in detail

    Let me know if you have probelms

    LVL 12

    Author Comment

    Hi there;

    I didn't create the whole website but edited the site bindings and add non-www of it.

    Now, it works (You can try).

    But one thing is that in your link, it also says creating another website and point it to non-www but i got the confusion of showing the project path. Since it's the same project. Don't you think there will be conflicts?

    LVL 77

    Expert Comment

    by:David Johnson, CD, MVP
    better to do it in your dns settings just point and to the same address
    LVL 6

    Expert Comment

    You can just do it in the dns settings, but search engines prefer a 301 redirect. Which is basically, creating a second site and redirecting it to the first.
    It's not a big job. Just create a new site, create a blank page, and then right click, change its properties to redirect it to the other site.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Occasionally you run into the website or two that will not resolve properly using your own DNS servers.  Some people simply set up global forwarders for their DNS server.  I don’t recommend doing this because it can cause problems resolving addresse…
    BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (, affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now