Monday, April 3, 2017

URL Redirections - ASP.NET Sites



If your site is hosted on IIS server , you can  do the re-directions as below.

1.0 Add URLs as below to web config file . 

 
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

 <location path="home/about-us/meet-the-team/stephanie-brennan">
      <system.webServer>
        <httpRedirect enabled="true" destination="https://www.ibuynew.com.au/home/about-us/meet-the-team" httpResponseStatus="Permanent" exactDestination="true" />
      </system.webServer>
    </location>
 <location path="home/about-us/meet-the-team/nicholas-de-la-paz">
      <system.webServer>
        <httpRedirect enabled="true" destination="https://www.ibuynew.com.au/home/about-us/meet-the-team" httpResponseStatus="Permanent" exactDestination="true" />
      </system.webServer>
    </location>

</configuration>

2.0 Make sure to remove back slash, after the path property.
 Otherwise site won't work.
 <location path="home/about-us/meet-the-team/stephanie-brennan">