Neir0
Neir0

Reputation: 13367

Redirect from www urls to non-www urls in iis

I want to set redirect from www.MySite.com to MySite.com for my asp.net application in internet information services. How can i do it?

Upvotes: 0

Views: 180

Answers (2)

Gaurish
Gaurish

Reputation: 121

<rewrite>
<rules>
    <rule name="Redirect domain.com to www" patternSyntax="ECMAScript" stopProcessing="true">
        <match url=".*" />
        <conditions>
            <add input="{HTTP_HOST}" pattern="^domain.com$" />
        </conditions>
        <action type="Redirect" url="http://www.domain.com/{R:0}" />
    </rule>
</rules>

Upvotes: 0

sudheshna
sudheshna

Reputation: 1150

In IIS you can set this in the Home Directory" tab by clicking the option "A redirection to a URL".

Upvotes: 2

Related Questions