Loading ...

Redirect permanent (301) for a specific page via web.config | CodeAsp.Net

Redirect permanent (301) for a specific page via web.config

 /5
0 (0votes)

I had to redirect one particular page to different destination for an application. I wanted to do this via web.config only. This is what I did:

<location path="default.aspx">
    <system.webServer>
      <httpRedirect enabled="true" destination="aboutus" httpResponseStatus="Permanent" />
    </system.webServer>
  </location>

Source: /default.aspx
Target: /aboutus

You can add the above element directly under "<configuration>" tag.

Comments (no comments yet)

Top Posts