How to redirect with ASP classic

五迷三道 提交于 2019-12-22 05:24:28

问题


I want to redirect from one URL to another:

http://female.deals.com/

http://male.deals.com/

How can I achieve that with the URL changing to the new URL in the browser and with a page going straight to the new URL without going to the old URL and making a refresh?

I looked through some scripts on the Internet and they didn’t work, I also don’t know ASP classic. So I am struggling to make that redirect work.


回答1:


<%
    Response.Redirect "http://www.sitename.com"
%>

And plus for "all" the querystrings browser url has:

<%
    Response.Redirect "http://www.sitename.com/?" & Request.QueryString
%>



回答2:


In the default.asp page that is listed as the start up page in IIS, comment out all the HTML and put in this ASP classic code:

<%
Response.Redirect "http://male.deals.com/"
%>

To keep the Query String parameters you would use this code:

<% response.redirect("http://male.deals.com/newpage.asp" & "?id=" & request.querystring("id")) %> 

Another way is a ISAPI filter, Helicon ISAPI rewrite.



来源:https://stackoverflow.com/questions/11381026/how-to-redirect-with-asp-classic

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