• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

SSLRequireSSL in .htaccess causes Apache 2 Test Page to be shown

Simon1234

New Pleskian
Hi, I've encountered the following problem, and after searching for and attempting a couple of different solutions, I've gotten no closer to getting it solved.

I've got a password-protected site on a subdomain that should only be accessible over https. To do this I have the following in .htaccess, as suggested here:

Code:
SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "subdomain.domain.tld"
ErrorDocument 403 https://subdomain.domain.tld

AuthType Basic
AuthName "Authentication Promt"
AuthUserFile /var/www/vhosts/subdomain.domain.tld/public_html/.htpasswd
Require valid-user

However, whenever SSLRequireSSL is on, http://subdomain.domain.tld shows the Apache 2 standard test page instead of redirecting to https. http://subdomain.domain.tld/index.html redirects to https://subdomain.domain.tld just fine however, and any connection directly over https works fine as well.

This seems related, but after checking the DirectoryIndex directives, I haven't found anything missing there.

The problem is somewhat similar to the one in this thread, but I've confirmed that mod_spdy isn't running on the server.

Anyone have suggestions for a solution to this?
 
Hi Simon1234,

first I strongly recommend to use the Plesk integrated "Password Protected Directories" ( Start > subscription > example.com > Password Protected Directories ) , because it's easy to use and you don't have to care about misconfigurations. As well, it uses a slightly different path for the password - files, which is much more secure.

I would use the following code, placed in the additional apache directives and suggested as well at: https://wiki.apache.org/httpd/RedirectSSL
Code:
 Start > Subscriptions > domain.tld > Websites & Domains > subdomain.domain.tld > Webserver-Settings

in HTTP directives:

Redirect permanent / https://subdomain.domain.tld/

Be aware that IF you use nginx as well, you have to set an additional entry for your protection as well, which is slightly different and can't be set over the Plesk Control Panel ( not yet implemented ).
 
Back
Top