[svlug] redirecting http request on https port

Bill Jonas bill at billjonas.com
Tue Jul 17 20:50:02 PDT 2001

On Tue, Jul 17, 2001 at 03:11:12PM -0800, mayssat at hushmail.com wrote:
> I have a secure web server running on port 443 (https). I would like to 
> redirect all request to this port.
> Is it possible ?
> I had a look at mod_rewrite and mod_proxy but am not sure I am looking in 
> the right direction.
> Any help ? 

Uh, just send a 302 for any requests on port 80 to the same thing on
port 443?

On a shell account I have, the .htaccess file is as follows:

Redirect /~bj/ http://www.billjonas.com/

And this is with Apache 1.1.1.

I see no reason why it couldn't be https instead of http.  Just use a
different DocumentRoot for secure and insecure.  (You don't even need to
run two separate Apache daemons.)  In your /.htaccess file for port 80,
just put something like:

Redirect http://mysite/ https://mysite/

And then in the DocumentRoot for port 443, put your actual content.

Bill Jonas    *    bill at billjonas.com    *    http://www.billjonas.com/
"As we enjoy great advantages from the inventions of others,  we should
be glad of an opportunity to serve others by any invention of ours; and
this we should do freely and generously."          -- Benjamin Franklin

More information about the svlug mailing list