Monday, October 24, 2016

Website shows Forbidden message when using HTTPS

Leave a Comment

I have this in my htaccess file

Options +FollowSymLinks -MultiViews RewriteEngine On RewriteBase / Options -Indexes  RewriteRule ^login/?$ login.php [L] RewriteRule ^logout/?$ logout.php [L]  # This will process the /section/(.*) requests, ?section=1 will be appended to query string     RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^section\/(.*)?$ index.php?section=1&id=$1 [L,QSA]  # This will process all other requests RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([a-zA-Z0-9-/_]+)/?$ index.php?id=$1 [L,QSA] 

I have installed an SSL Certificate on my domain (wildcard SSL) to cover all subdomains.

When visiting my subdomain admin. using HTTPS, it returns a forbidden page.

I have tried adding %{HTTP_HOST} in front of all my RewriteCond's but i still see the same forbidden message

1 Answers

Answers 1

Make sure you have setup a seperate virtual host in Apache config for SSL

 <VirtualHost *:443>         SSLEngine On         SSLCertificateFile /etc/ssl/certs/example.com.crt         SSLCertificateKeyFile /etc/ssl/private/example.com.key         SSLCACertificateFile /etc/ssl/certs/ca-certificates.crt  #If using a self-signed certificate, omit this line          ServerAdmin info@example.com         ServerName www.example.com         DocumentRoot /var/www/example.com/public_html/         ErrorLog /var/www/example.com/log/error.log         CustomLog /var/www/example.com/log/access.log combined </VirtualHost> 

Also, please make sure you have place the certification files on the correct part and your server port 443 is open to listen.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment