Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Response.Redirect redirecting but not showing correct url

Status
Not open for further replies.

Dabase

Programmer
Apr 2, 2004
122
0
0
PT
Hi

I have an ASP page that redirects the user to a url, depending on what group the user belongs to.

Code:
Code:
...
ElseIF session("domain") = "1" or session("domain") = "3" Then
	Response.Redirect("homepage.asp")
ElseIF session("domain") = "2" Then
	Response.Redirect("[URL unfurl="true"]http://www.url-2.com/index.asp")[/URL]
End If
...

This redirects to the correct url, but on the Address box in Internet Explorer, it shows url-1 as opposed to the url-2 (e.g. instead of
Any ideas where I am going wrong?


Thanks
Dabase
 
You aren't doing anything wrong. A normal response.redirect command tells the browser that the requested resource has temporarily moved to another URL. The browser then (usually) requests that alternate URL.

You could try using client-side script to change pages.

Another thing that might work is to tell the browser that the requested resource has permanantly moved. Something like this:
Code:
<%
Response.Status="301 Moved Permanently" 
Response.AddHeader "Location", "[URL unfurl="true"]http://www.url-2.com/index.asp"[/URL] 
Response.End
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top