• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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