I've finished developing a website using ASP.NET Webforms and to finish it off I'm in the process of setting up some 301 redirects to ensure the old site's links are redirected properly.
However, the old website was written in classic ASP. What is the best way to set up redirects from old .asp pages to new .aspx pages? (Note: I don't have control over the server the website is being hosted on so I can't do anything in IIS)
Just place this at the top of your page before any output:
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.example.com/new-url"
%>
Don't put any response.redirects
below this code.
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