Re: [PHP] redirect http to https

2007-04-10 Thread Chris
?php if($_SERVER['SERVER_PORT'] !== $encport || $_SERVER['HTTPS'] !== on) {header(Location: https://.$_SERVER['SERVER_NAME'].$_SERVER['SCRIPT_NAME']);exit;} ? Very bad solution. Don't just tell us it's bad, explain why (even with an RTFM or URL to look at)... nobody learns from an answer

Re: [PHP] redirect http to https

2007-04-10 Thread Zoltán Németh
I have separate document roots for the http and the https stuff, say htdocs and htdocs-secure - this can be done with apache configuration then I need only to put a single redirecting line into the htdocs/index.php like ?php header(Location: https://my.server.com/;); ? and that's all greets

Re: [PHP] redirect http to https

2007-04-10 Thread Jason Karns
On 4/10/07, Zoltán Németh [EMAIL PROTECTED] wrote: I have separate document roots for the http and the https stuff, say htdocs and htdocs-secure - this can be done with apache configuration then I need only to put a single redirecting line into the htdocs/index.php like ?php header(Location:

Re: [PHP] redirect http to https

2007-04-10 Thread Richard Lynch
On Mon, April 9, 2007 8:38 am, Martin Marques wrote: Ben Liu escribió: What's the prescribed method for redirecting a user forcibly to from the non-SSL secured version of a page to the SSL-secured version? Is this handled at the web server level or at the script level. I found this by

[PHP] redirect http to https

2007-04-09 Thread Ben Liu
What's the prescribed method for redirecting a user forcibly to from the non-SSL secured version of a page to the SSL-secured version? Is this handled at the web server level or at the script level. I found this by googling: ?php if($_SERVER['SERVER_PORT'] !== $encport || $_SERVER['HTTPS']

Re: [PHP] redirect http to https

2007-04-09 Thread edwardspl
Ben Liu wrote: What's the prescribed method for redirecting a user forcibly to from the non-SSL secured version of a page to the SSL-secured version? Is this handled at the web server level or at the script level. I found this by googling: ?php if($_SERVER['SERVER_PORT'] !== $encport ||

Re: [PHP] redirect http to https

2007-04-09 Thread Martin Marques
Ben Liu escribió: What's the prescribed method for redirecting a user forcibly to from the non-SSL secured version of a page to the SSL-secured version? Is this handled at the web server level or at the script level. I found this by googling: This should be done with the rewrite instruction

Re: [PHP] redirect http to https

2007-04-09 Thread Ben Liu
On 4/9/07, Martin Marques martin@bugs.unl.edu.ar wrote: This should be done with the rewrite instruction of apache, or what ever instructionyour web server has. Um...guess I will have to check with our hosting company about this. Thanks. - Ben -- PHP General Mailing List

Re: [PHP] redirect http to https

2007-04-09 Thread edwardspl
Ben Liu wrote: On 4/9/07, Martin Marques martin@bugs.unl.edu.ar wrote: This should be done with the rewrite instruction of apache, or what ever instructionyour web server has. Um...guess I will have to check with our hosting company about this. Thanks. - Ben Hello, FYI : ?php

Re: [PHP] redirect http to https

2007-04-09 Thread Tijnema !
On 4/9/07, Ben Liu [EMAIL PROTECTED] wrote: What's the prescribed method for redirecting a user forcibly to from the non-SSL secured version of a page to the SSL-secured version? Is this handled at the web server level or at the script level. I found this by googling: ?php

RE: [PHP] redirect http to https

2007-04-09 Thread Peter Lauri
-Original Message- From: Ben Liu [mailto:[EMAIL PROTECTED] Sent: Monday, April 09, 2007 3:52 PM To: Martin Marques; PHP Subject: Re: [PHP] redirect http to https On 4/9/07, Martin Marques martin@bugs.unl.edu.ar wrote: This should be done with the rewrite instruction of apache

Re: [PHP] redirect http to https

2007-04-09 Thread Ben Liu
On 4/9/07, Peter Lauri [EMAIL PROTECTED] wrote: You might be able to do this by putting an .htaccess file in your webroot of non-ssl: -- RewriteEngine On RewriteRule ^/(.*)$ https://www.yourdomain.com/$1 [L] -- This appears to work: RewriteEngine On RewriteCond %{SERVER_PORT}