Set up 301 redirects from old classic ASP pages to new ASP.NET webforms pages

asp-classicasp.nethttp-status-code-301redirect

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)

Best Solution

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.

Related Question