473,569 Members | 2,783 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

force web root into https; redirect issues

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 they
come in on http. The site is also using an instant refresh on the
index.htm page under root to www.waynesavings.com/aboutus/home.htm due
to issues with the javascript menus used on the site.

The code we're using on the custom 403 page is this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%

If UCase(Request.S erverVariables( "HTTPS")) = "OFF" Then
'''get page
sRedirect = "https://" & Request.ServerV ariables("SERVE R_NAME") &
Request.ServerV ariables("PATH_ INFO") & Request.Queryst ring
Response.Redire ct sRedirect
End If

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitl ed Document</title>
</head>

<body>
</body>
</html>

It does the job just fine. However, if somebody has bookmarked a
non-secure page (e.g. http://www.waynesavings.com/rates/index.htm), it
will redirect the user NOT to the equivalent https page, but to the
secure home page instead.

Any input? If I can't get this solved, we'll just turn something bad
into something good and encourage people to rebookmark the respective
pages, but the perfectionist in me would like to see this solved.

Thanks!

Aug 22 '06 #1
2 4110
Your custom 404 is causing it. Look at what happens when you go here:

http://www.waynesavings.com/kjaskjfl...jn3r.hhasjdhfk

Ray at work


"Sergej Prokoviev" <pe************ *@hotmail.comwr ote in message
news:11******** *************@b 28g2000cwb.goog legroups.com...
</html>

It does the job just fine. However, if somebody has bookmarked a
non-secure page (e.g. http://www.waynesavings.com/rates/index.htm), it
will redirect the user NOT to the equivalent https page, but to the
secure home page instead.

Aug 23 '06 #2
Thanks for the tip! I did look into it, and I think what's happening is
that the custom 403 gets called before the custom 404, so you get the
home page when you type in a non-existing http page. When you are in
https mode, the 404 is called as it should.

I've looked all over for the right code for this redirect, and it seems
that everybody is asking the question, but nobody seems to have the
(full) answer. The 403 does redirect, just not the right way. I think
it ignores the path and just redirects to root, which is promptly
refreshed to ../aboutus/home.htm.

Any thoughts?

Ray Costanzo [MVP] wrote:
Your custom 404 is causing it. Look at what happens when you go here:

http://www.waynesavings.com/kjaskjfl...jn3r.hhasjdhfk

Ray at work


"Sergej Prokoviev" <pe************ *@hotmail.comwr ote in message
news:11******** *************@b 28g2000cwb.goog legroups.com...
</html>

It does the job just fine. However, if somebody has bookmarked a
non-secure page (e.g. http://www.waynesavings.com/rates/index.htm), it
will redirect the user NOT to the equivalent https page, but to the
secure home page instead.
Aug 23 '06 #3

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

Similar topics

5
89857
by: Bob Hansen | last post by:
I am using the following code in my default.asp page to redirect the page from HTTP to HTTPS <% if Request.ServerVariables("HTTPS") = "off" Then Response.Redirect("https://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("URL"))
2
7787
by: Robert Gordon | last post by:
I now realize I probably should have tried posting this on the IIS board first.. I am running OWA 2003 Server as Front End server to my Exchange 2000 native domain. The FE server is secured by a 128 bit SSL cert. The OWA 2003 server is running on Windows 2003 server in a Windows 2003 native AD domain. At present, the server is...
0
1690
by: Dmitry Akselrod | last post by:
Hello everyone, I am in the process of implementing an internal Certificate Authority on a client's network. The CA will issue certificates to several intranet web apps that will be accessible to remote users. I would like to programmatically add the Root CA cert to the users' Trusted Root CA store. I have reviewed dseveral articles...
3
1500
by: Marlon | last post by:
I have a site that is now SSL secured. User not still using the http:// to get to the site. How can I redirect the user the the visited page using https:// ?
4
1149
by: Jens Jensen | last post by:
Hello gurus, We have a site that need security upgrade to run over https. We want people to be redirected to https:oursite when the type what the know, http:oursite. Is this possible? How? mnay thanks JJ
7
13434
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 checked require secure channel, require 128-bit encryption. In custom error, instead of using default message HTTP 403.4 - Forbidden: SSL required...
8
5131
by: howa | last post by:
a page currently in HTTPS, I force the client to redirect to another page using HTTP under the same domain (e.g. abc.com), i.e. header("Location: http://www.abc.com/index.php"); IE successfully redirect to HTTP, but FF & Opera stay on the HTTPS any suggestions?
0
4342
by: Raven | last post by:
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
1
4099
by: jdwfly | last post by:
Just before I go an tell my sys admin that the server has problems I wanted to run this by everyone on here. Basically we have a few pages that need to be sent over https. Everything I have found on the internet resulted in this code If (Request.ServerVariables("HTTPS") = "off") Then srvname = Request.ServerVariables("SERVER_NAME")...
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7931
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7984
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5515
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3663
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3655
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2119
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 we have to send another system
0
954
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.