• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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