469,925 Members | 1,548 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,925 developers. It's quick & easy.

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("Location: 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 4885
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("Location: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("Location: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...@hotmail.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("Location: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...@hotmail.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("Location: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...@hotmail.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("Location: ...") ?
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...@hotmail.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("Location: ...") ?

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...@hotmail.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("Location: ...") ?
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
"ensureHTTPS" 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("Location: 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.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jun 6 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by deko | last post: by
4 posts views Thread by Akimeu | last post: by
5 posts views Thread by Bob Hansen | last post: by
6 posts views Thread by scottyman | last post: by
2 posts views Thread by Sergej Prokoviev | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.