checking the url

R

Rob

Hello

I am trying to redirect users to a secure page by using
Response.Redirect(Request.Path.Replace("https://",http://"))
or
Response.Redirect(Request.RawUrl.Replace("https://",http://"))

both of which I have seen suggested on this newsgroup.

However, both Request.Path and Request.RawUrl return the url after the
domain, ie instead of http://somedomain.com/abc.aspx I get just
abc.aspx so neither method works.

I have formed the url using
Request.ServerVariables["SERVER_NAME"]
and
Request.ServerVariables["URL"]

But it bothers me that the 2 previously suggested methods won't work.
Is there a configuration setting to make ASP.NET return the full url
including protocol, server name and query strings ? Or am I doing
something else wrong ?

Thanks in advance
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top