7

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.

Chuck D
  • 1,629
  • 2
  • 16
  • 32
Dmitry Makovetskiyd
  • 6,942
  • 32
  • 100
  • 160

2 Answers2

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

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

<%
    Response.Redirect "http://www.sitename.com/?" & Request.QueryString
%>
htbasaran
  • 869
  • 7
  • 10
3

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.

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321
  • is there also a way to take the current query string that is inside the browser url and put at the end of the url.. I want the user to be redirected to a different domain.. but that domain has the same pages as the other domain – Dmitry Makovetskiyd Jul 08 '12 at 06:11
  • ok, glad the version without the angle tags and percentages is an acceptable answer. – Jeremy Thompson Jul 08 '12 at 06:57