How do I programatically 301 redirect in an asp pa

2019-01-20 05:00发布

问题:

I'm upgrading some classic asp pages to .net, but not all of them. Rather than go and modify all the links in this backwards system, which pulls some of its links from a cms data store. I would like to take advantage of http and just remove the code our of that file, and perform a programatic 301 so that all the other pages can just be upgraded piecemeal.

回答1:

Response.Buffer = true
Response.Status = "301 Redirect"
Response.AddHeader "Location", "redirection-url-goes-here"
Response.End