Setting up redirect in web.config file

  1. Open web.config in the directory where the old pages reside

  2. Then add code for the old location path and new destination as follows:

     <configuration>
       <location path="services.htm">
         <system.webServer>
           <httpRedirect enabled="true" destination="http://example.com/services" httpResponseStatus="Permanent" />
         </system.webServer>
       </location>
       <location path="products.htm">
         <system.webServer>
           <httpRedirect enabled="true" destination="http://example.com/products" httpResponseStatus="Permanent" />
         </system.webServer>
       </location>
     </configuration>
    

You may add as many location paths as necessary.

Leave a Comment