Posted on

IIS redirect from a site to another site

We must redirect the pages of a site on the pages of another site by changing the main address of the site and keeping the relative addresses of the pages the same. So :

http://blog.mecdata.it/default.aspx will be redirect in https://www.mecdata.it/default.aspx

On our server we need to install an additional IIS module: “HTTP Redirection“.

installing http redirection

in IIS, in your site (in this example blog.mecdata.it) select Http Redirection module and compile it in this way

this configuration will create a web.config file in your site root :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpRedirect enabled="true" destination="https://www.mecdata.it" exactDestination="false" childOnly="false" />
    </system.webServer>
</configuration>

That’all

more information : https://manage.accuwebhosting.com/knowledgebase/988/How-to-set-website-redirection-from-IIS-7.html