473,836 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't redirect from HTTPS to HTTP in Firefox?

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("Locatio n: http://www.abc.com/index.php");

IE successfully redirect to HTTP,

but FF & Opera stay on the HTTPS

any suggestions?

thanks.

Jun 6 '07 #1
8 5145
On Jun 6, 7:53 am, howa <howac...@gmail .comwrote:
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("Locatio n:http://www.abc.com/index.php");

IE successfully redirect to HTTP,

but FF & Opera stay on the HTTPS

any suggestions?

thanks.

I just dealt with this, and I ended up using an .htaccess file to
rewrite http or https as appropriate. Have you considered this
approach?

Jun 6 '07 #2
On Jun 6, 8:53 pm, howa <howac...@gmail .comwrote:
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("Locatio n:http://www.abc.com/index.php");

IE successfully redirect to HTTP,

but FF & Opera stay on the HTTPS

any suggestions?
Use HTTP sniffers (say, LiveHTTPHeaders ) or post the URL.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jun 6 '07 #3
On Jun 7, 12:35 am, e_matt...@hotma il.com wrote:
On Jun 6, 7:53 am, howa <howac...@gmail .comwrote:
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("Locatio n:http://www.abc.com/index.php");
IE successfully redirect to HTTP,
but FF & Opera stay on the HTTPS
any suggestions?
thanks.

I just dealt with this, and I ended up using an .htaccess file to
rewrite http or https as appropriate. Have you considered this
approach?

you mean mod_rewrite or just apache redirect?

Jun 6 '07 #4
On Jun 6, 8:43 am, howa <howac...@gmail .comwrote:
On Jun 7, 12:35 am, e_matt...@hotma il.com wrote:
On Jun 6, 7:53 am, howa <howac...@gmail .comwrote:
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("Locatio n:http://www.abc.com/index.php");
IE successfully redirect to HTTP,
but FF & Opera stay on the HTTPS
any suggestions?
thanks.
I just dealt with this, and I ended up using an .htaccess file to
rewrite http or https as appropriate. Have you considered this
approach?

you mean mod_rewrite or just apache redirect?

I'm not sure exactly what it's called, but this is how it works. I
have one folder containing all the pages that should only be served
over https. In that folder, I have an htaccess file that contains the
following lines:

RewriteEngine On
RewriteCond %{SERVER_PORT} !443
RewriteRule (.*) https://%{SERVER_NAME}% {REQUEST_URI}
That ensures any request to this folder is served over https. There
are many links out from this folder, so following one of those links
might keep the user on https longer than necessary. So, in the public
html folder there is an htaccess file with these lines:

RewriteEngine On
RewriteCond %{SERVER_PORT} 443
RewriteRule (.*) http://%{SERVER_NAME}% {REQUEST_URI}

Works well so far.

Jun 6 '07 #5
On Jun 7, 12:54 am, e_matt...@hotma il.com wrote:
>
I'm not sure exactly what it's called, but this is how it works. I
have one folder containing all the pages that should only be served
over https. In that folder, I have an htaccess file that contains the
following lines:
ok, thx, i will try that!

but i want to confirm, are yo having the same problem, i.e. IE work,
but FF didn't work when just setting using header("Locatio n: ...") ?
Jun 6 '07 #6
Rik
On Wed, 06 Jun 2007 19:01:24 +0200, howa <ho******@gmail .comwrote:
On Jun 7, 12:54 am, e_matt...@hotma il.com wrote:
>>
I'm not sure exactly what it's called, but this is how it works. I
have one folder containing all the pages that should only be served
over https. In that folder, I have an htaccess file that contains the
following lines:

ok, thx, i will try that!

but i want to confirm, are yo having the same problem, i.e. IE work,
but FF didn't work when just setting using header("Locatio n: ...") ?

It could very well be a security measure they've implemented (haven't
tested it though). Normally, these are also the browsers that in default
setting will alert you when leaving a secure connection, so it might be
that instead of checking the redirects they require the same or better
security on redirects.
--
Rik Wasmus
Jun 6 '07 #7
On Jun 6, 8:01 am, howa <howac...@gmail .comwrote:
On Jun 7, 12:54 am, e_matt...@hotma il.com wrote:
I'm not sure exactly what it's called, but this is how it works. I
have one folder containing all the pages that should only be served
over https. In that folder, I have an htaccess file that contains the
following lines:

ok, thx, i will try that!

but i want to confirm, are yo having the same problem, i.e. IE work,
but FF didn't work when just setting using header("Locatio n: ...") ?
I did not even get far enough with redirects to notice an issue with
IE vs. FF. Redirects worked on FF, but I ended up creating an
"ensureHTTP S" file and "ensureHTTP " file, and including them as
appropriate on all pages. Ugly maintenance when you need to include
one or the other on every page. Two access files took care of
everything. Also, I think php will load the whole page and then
execute the redirect, which is unnecessary work.

Jun 6 '07 #8
On Wed, 06 Jun 2007 08:53:08 -0700, howa <ho******@gmail .comwrote:
>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("Locati on: http://www.abc.com/index.php");

IE successfully redirect to HTTP,

but FF & Opera stay on the HTTPS
Works as expected for me; Opera 9.21, Firefox 2.0.0.4, IE 7.

--
Andy Hassall :: an**@andyh.co.u k :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jun 6 '07 #9

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

Similar topics

7
11165
by: deko | last post by:
I have a login page that is supposed to redirect the user to his private page after login. But header("Location: $url") does not work after I set the $_SESSION variable - I get "Warning: Cannot modify header information - headers already sent by ... The abbreviated code on the login page looks like this: <?php session_start(); ?>
4
1527
by: Akimeu | last post by:
Hello all... I have a site running http/https on it. I would like to redirect all http incoming requests to the https (SSL). Unfortunately, what I'm trying does not work.... I basically created an index.php in the DocumentRoot, modified http.conf file and restarted apache w/out any luck. The contents of the index.php file are as follows: <? header("location:https://sitename.com/index.html"); exit;
5
89962
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
7816
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 configured so that user's have to specifically go to the URL httpS://myserver.company.com in order to access...
1
2259
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 to redirect to https://www.example.com (https) Exact error is:
6
4908
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
2
4125
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 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...
2
2128
by: sbettadpur | last post by:
Hi everybody, Iam facing problem with redirecting http: connection to https: Here iam Running my scripts on Apache using normal http request... but i want to redirect my http url to https url for securing data How should i do this... don't say like redirect("Location:https://localhost/index.php"); because i tried It is not working... Please let me know ..? is there any another way to do this...
1
4131
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") scrname = Request.ServerVariables("SCRIPT_NAME") Response.Redirect("https://" & srvname & scrname)...
0
9825
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10852
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10556
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10257
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9383
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6980
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4459
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
2
4022
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.