Friday, January 23, 2009

Classic ASP Permanent Redirect

In Classic ASP, the Response.Redirect method causes the server to send a temporary redirect code (302) in the response header.

To send a permanent redirect code (301) in the response header, use the following code instead:

Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "/new-page.asp"
Response.End

Replace "/new-page.asp" with the absolute or relative URL of the destination page.

No comments: