How do I programatically 301 redirect in an asp page?

旧时模样 提交于 2019-11-27 07:22: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


来源:https://stackoverflow.com/questions/868851/how-do-i-programatically-301-redirect-in-an-asp-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!