You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Axel Siebenwirth <ax...@hh59.org> on 2002/09/03 18:37:45 UTC

[users@httpd] Automatically connect to https port

Hello Apache users,

I'm using apache for private purposes and have created my own SSL
certificates.

Now I would like to configure my system in such a way that when a client is
connecting to default http port 80 it gets automatically redirected to https
port 443.

Can this be done within apache configuration or does this need to be done
via iptables. If the latter is the case, how should it be done?

Thank you very much for your help,
my regards,

Axel Siebenwirth

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Automatically connect to https port

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.

On Tue, 3 Sep 2002, Axel Siebenwirth wrote:

> Hi Dirk-Willem!
>
> On Tue, 03 Sep 2002, Dirk-Willem van Gulik wrote:
>
> > Check the archive - about 12 hours ago some asked the same question. That
> > answer may be of use :-)
>
> I'm subscribed to users@httpd.apache.org and have not found any mails in the
> recent three days that somehow address my question.
>
Here goes:

On Tue, 3 Sep 2002, haiwen hu wrote:

> I plan to accomplish as following :
> when clients are accessing our website http://www.example.com
> ,automatically redirect all accesses to https://www.example.com.

<VirtualHost *:80>
        Servername www.example.com

        Documentroot    /usr/local/www/data/none/
        TransferLog     /usr/local/www/data/asemantics/intranet/access-log

        RewriteEngine on
        RewriteRule     ^(.*)   https://www.example.com$1 [R=301]
</VirtualHost>

For the truly paranoid - you can also -check- that the connection is SSL
and take action then:

<Directory "/usr/local/www/example.com">
        Options Indexes FollowSymLinks ExecCGI
        AllowOverride None

        Order deny,allow
        allow from all

        # Make rather sure we are using TLS before we start
        # messing with passwords and all that.
        #
        RewriteEngine On
        RewriteCond %{HTTPS} !=on
        RewriteRule (.*) https://www.example.net/$1 [R]

</Directory>

Dw



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Automatically connect to https port

Posted by Axel Siebenwirth <ax...@hh59.org>.
Hi Dirk-Willem!

On Tue, 03 Sep 2002, Dirk-Willem van Gulik wrote:

> Check the archive - about 12 hours ago some asked the same question. That
> answer may be of use :-)

I'm subscribed to users@httpd.apache.org and have not found any mails in the
recent three days that somehow address my question.

What mail do you mean? Can you mail me the subject of it, please?

Best regards,
Axel Siebenwirth


> > I'm using apache for private purposes and have created my own SSL
> > certificates.
> >
> > Now I would like to configure my system in such a way that when a client is
> > connecting to default http port 80 it gets automatically redirected to https
> > port 443.
> >
> > Can this be done within apache configuration or does this need to be done
> > via iptables. If the latter is the case, how should it be done?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Automatically connect to https port

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.
Check the archive - about 12 hours ago some asked the same question. That
answer may be of use :-)

Dw

On Tue, 3 Sep 2002, Axel Siebenwirth wrote:

> Hello Apache users,
>
> I'm using apache for private purposes and have created my own SSL
> certificates.
>
> Now I would like to configure my system in such a way that when a client is
> connecting to default http port 80 it gets automatically redirected to https
> port 443.
>
> Can this be done within apache configuration or does this need to be done
> via iptables. If the latter is the case, how should it be done?
>
> Thank you very much for your help,
> my regards,
>
> Axel Siebenwirth
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org