Total Pageviews

Wednesday, November 19, 2014

Redirections using Web.config

Page redirections for different domain

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   
<location path="hydro-burn">
      <system.webServer>
        <httpRedirect enabled="true" destination="http://www.example.com.au/hydro-burn" httpResponseStatus="Permanent" />
      </system.webServer>
    </location>

<location path="hydro-whey">
      <system.webServer>
        <httpRedirect enabled="true" destination="http://www.example.com.au/hydro-whey" httpResponseStatus="Permanent" />
      </system.webServer>
    </location>

<location path="amino-fuel">
      <system.webServer>
        <httpRedirect enabled="true" destination="http://www.example.com.au/amino-fuel" httpResponseStatus="Permanent" />
      </system.webServer>
    </location>

</configuration>

Domain redirections

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpRedirect enabled="true" destination="http://www.example.com.au" exactDestination="true" httpResponseStatus="Permanent" />
    </system.webServer>
</configuration>