httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zac Stevens <>
Subject Re: Problem between http and https
Date Wed, 31 Jul 2002 12:35:22 GMT
Hi Edward,

On Wed, Jul 31, 2002 at 05:11:23PM +0800, wrote:
> I have just got another function with php from my netfriend :
> create a index.php :
> <? header("Location:");exit;?>
> So, which function is the best for me ?

I think for your particular situation, either will work - but there is a

The solution described by myself and others (using mod_rewrite) is flexible
in that it will redirect /any/ request to the appropriate HTTPS page.

eg, user goes to

With the mod_rewrite approach, this request would automatically be
redirected to

Using the index.php redirect as above, you would probably get a 404 "File
not found" error.  The answer would be to put the index.php into every
place where people could access your website, however this means a lot of
extra work for you.

Also, to use this you /must/ create a separate DocumentRoot for the non-SSL
site which contains the index.php file - you can't use the same
DocumentRoot as the SSL site, as it will probably have its own index.php
used by the webmail program.

In your case - where you are only supporting a webmail program where every
user has to start at the beginning of the site - both options will do what
you are trying to achieve.  I think the mod_rewrite option is less work for
you, but it does require that you have mod_rewrite in your server.

Hope that helps,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message