I've never done 301s in asp, always worked with .htaccess and things were good. Currently need to redirect a whole site to the root of a new site (sitewide to root). I only have FTP access to the server. Site is old asp site using some sort of cms.
I tried the below code and got an error message:
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "myNewSite.com"
%>
This is my global.asa file:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
End Sub
Sub Application_OnEnd
'nothing needed here for this example
End Sub
Sub Session_OnStart
Application.lock
Application("ActiveUsers") = Application("ActiveUsers") + 1
Application.unlock
End Sub
Sub Session_OnEnd
Application.lock
Application("ActiveUsers") = Application("ActiveUsers") - 1
Application.unlock
End Sub
</SCRIPT>
Can anyone please, please post the modified code for a 301? Also, I'm new to developing, and not sure about line breaks in all the asp code snippets I see online.