473,473 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Trying to Redirect from https to http (secure to non secure)

Hi,

I have a problem with a server side redirect from a secure page to a
non-secure page (same domain name, same folder)

I have added some test code that can display the target URL and that
containt http:// and yet it redirects to https://
example:

I am on
https://www.example.com/test/files/login.asp?Cmd=logout
enter username+password into a form; page posts back to itself, then
calls my function for redirection to non secure pages:

redirectNoSSL("myaccount.asp")

this executes
Response.Redirect "http://www.example.com/test/files/myaccount.asp"

but the browser goes to
https://www.example.com/test/files/myaccount.asp

Any ideas why this happens?

I suspect this has to do with a cookie that persists user/pwd info,
could that force the client to go to the Secure page?

thanks in advance
Axel

See my relevant code below:

Function stripSSL(sTarget)
Dim host
Dim sUrl
Dim i
stripSSL=""
if sTarget="" Then Exit Function

sUrl=Request.ServerVariables("URL")
host=Request.ServerVariables("server_name") '
Request.ServerVariables("HTTP_HOST")

sTarget=" & sTarget
i=InStrRev(sUrl, "/")
stripSSL= "http://" & host & Left(sUrl,i) & sTarget
End Function

Function redirectNoSSL(sUrl)
Dim sNewURL
sNewURL = stripSSL(sUrl)
If False Then ' Print link instead of redirect
Response.Write "<BODY>TEST: Redirect to stripSSL (" & sUrl & ") =
<a href=" & sNewURL & ">" & sNewURL & "</a>"
Response.Write "<BR>ServerVariables(HTTPS)=" &
Request.ServerVariables("HTTPS") & "</BODY>"
Response.End
Else
Response.Redirect sNewURL
End If
End Function
Nov 7 '08 #1
0 4323

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Larry Woods | last post by:
I am losing Session variables, but only those that are set in the page previous to a redirect to a secure page. Anyone seen ANY situation where Session variables just "disappear?" Note that...
3
by: Pooja Renukdas | last post by:
Hello, I have this web site where only two pages have to be secure pages and I need to call them using https, but since I have my development server and my production web server, I dont want to...
0
by: Jacob | last post by:
I would like to provide a login feature on my website that uses HTTPS/SSL. I've gotten all the certificates and have successfully done logins when the login page is secure. But I would prefer to...
1
by: E | last post by:
I have a login page that's https and after logging in should redirect to the home page http://www.example.com <form id="Form1" method="post" runat="server"> No matter what I've tried it tries...
5
by: Dabbler | last post by:
I'm sending users to a secure page https to fill out a registration form. When they're done I show a thank you page. I need to return the user to http mode after filling out the form. If I use...
2
by: Sergej Prokoviev | last post by:
We are running our site at www.waynesavings.com on secure hosting (Server 2003, IIS). We are using a custom 403.4 error page (called 403_4.asp, located under root) to redirect all users to https if...
7
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am trying to set this up using asp code and IIS configuration. But it seems not working. Here it is the way I am doing. In IIS I set up a virtual directory with secure communication, I...
1
by: kmithu | last post by:
I have a web site where I want to make the pages secures.ie. I want to redirect my pages to https.I have tried this doing so by making a self signed certificate and using...
2
by: RuthC | last post by:
Hi, In my website there is a facility for user to create there own pages we are maintaing this url as www.mywebsite.com/mypage/user created page name ex : www.mywebsite.com/mypage/ruth user...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.