• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Force https/SSL single domain; howto

DocGerry

New Pleskian
Plesk 9.5 on Ubuntu on a VPS. Three domains on the server, one of them has the SSL certificate which is the host name of the VPS server

SSL certificate installed myownsingledomain.com

All traffic to http://myownsingledomain.com and files and subdirectories I want to redirected to https://myownsingledomain.com

The domain is set to use the one directory httpdocs, and https://myownsingledomain.com works...the secured green thing comes up on browsers as authenticated until of course you click on any link and it takes you to back to http

Anyone clicking on http://myownsingledomain.com needs to be directed to https with a Rewrite.

The server seems to ignore .htaccess but there is probably a more elegant solution anyway. Perhaps it is so obvious I do not see anything in FAQ or searching the forum. I have searched around and do not find a Plesk specific solution.

Thanks
 
Put this in .htaccess

RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

And make sure your apache conf file has this in it somewhere
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
 
Back
Top