I have an HTML page in my old website which needs 301 redirect to the aspx page of new website, both websites have been built on asp.net platform. Please suggest me that how could I configure my web.config file to achieve this task. At the moment I am using Meta Refresh to do this, but that is possibly 200 not 301.
Any help would be highly appreciated,Thanks.
I have used following piece of code in my old website web.config file, but it isn't working as well
<configuration>
<location path="http://example.htm">
<system.webServer>
<httpRedirect enabled="true" destination="http://newwebsite.com/test.aspx" httpResponseStatus="Permanent" />
</system.webServer>
</location>
</configuration>
Create rules in your web.config file put
<system.webServer>
<rewrite>
<rules>
<rule name="URL1" stopProcessing="true">
<match url="^abc.html" ignoreCase="true" />
<action type="Redirect" url="Your current page path" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="http://uri" httpResponseStatus="Permanent" />
</system.webServer>
</configuration>
Sorry I don't have a web.config solution for single page. You'll want to place this in your markup page near the top:
<% RedirectPermanent("http://url", true) %>
If it doesn't work for you post your markup here and I'll update it for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With