mercredi 29 avril 2015

Windows Azure: redirect website from www to non-www

I have this web.config file on my server.

<?xml version="1.0" encoding="utf-8" ?>
            <rule name="HTTP to HTTPS redirect" stopProcessing="true">
                <match url="(.*)" />
                    <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
            <rule name="Rule" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="false" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
                    <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />

        <mimeMap fileExtension=".json" mimeType="application/json" />
        <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />

I want to redirect URL from www to non-www. For example, if user types, it should go to

How can I edit such a thing in above code. Thanks.

Aucun commentaire:

Enregistrer un commentaire