Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1655

Apache shows default page instead of https when using http

$
0
0

I'm trying to redirect all my foo.mydomain.com requests to https://foo.mydomain.com.

My VirtualHost contains this:

<VirtualHost *:443>    ServerName foo.mydomain.com    # Indexes + root dir    DirectoryIndex index.html    DocumentRoot /home/web/foo.mydomain.com/htdocs    SSLEngine on    SSLCertificateFile /etc/apache2/ssl/server.crt    SSLCertificateKeyFile /etc/apache2/ssl/server.key    SSLVerifyClient none<IfModule mime.c>            AddType application/x-x509-ca-cert      .crt            AddType application/x-pkcs7-crl         .crl</IfModule>    # Logfiles    ErrorLog /home/web/foo.mydomain.com/logs/error.log    CustomLog /home/web/foo.mydomain.com/logs/access.log combined</VirtualHost>

So now I'm trying to redirect all the http-request to https with mod_rewrite in this .htaccess file:

Options FollowSymLinksRewriteEngine OnRewriteCond %{HTTPS} offRewriteRule (.*) https://foo.mydomain.com

Does anyone knows what I'm doing wrong? Thank you in advance!


Viewing all articles
Browse latest Browse all 1655

Latest Images

Trending Articles



Latest Images