Responsive Ad Area

Share This Post

test

RHEL7 / Apache 2.4.6 not redirecting http to https

In /etc/httpd/conf.d/foo.conf I configured redirection like this

<VirtualHost *:80>
        Servername servera.example.com
        Redirect / https://servera.example.com/
</VirtualHost>

<VirtualHost *:443>
        DocumentRoot "/var/www/html"
        Servername servera.example.com

        SSLEngine on
        SSLCertificateFile /path/to/certificate
        SSLCertificateKeyFile /path/to/key
        <Location />
              ProxyPass http://localhost:8181/
              ProxyPassReverse http://localhost:8181
        </Location>
</VirtualHost>

So when I access https://servera.example.com it works fine.

But as soon as I try to access http://servera.example.com/ it is not redirected to https://servera.example.com/ I simply get a connection timeout.

I tried moving this configuration to /etc/httpd/conf/httpd.conf -> no success

Also tried using Rewrite:

RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]

The error log is not showing any error.


RHEL7 / Apache 2.4.6 not redirecting http to https
RHEL7 / Apache 2.4.6 not redirecting http to https
test
{$excerpt:n}

Share This Post

Leave a Reply

Your email address will not be Publishedd. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Skip to toolbar