Gauthier
New Pleskian
This is on:
OS: CentOS Linux 7.2.1511 (Core)
Plesk version: 12.5.30 Update #27
My ssl certificate is for www.example.com
Using the "Additional directives for HTTP " text area in plesk, I can redirect http://example.com and http://www.example.com, both to httpS://www.example.com.
I also want to redirect https://example.com to https://www.example.com
But the "Additional directives for HTTPS" text area is apparently not working. I fill it with:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI}
Checked it was actually wrote to the vhost_ssl.conf, and restarted apache.
As far as I know this should be rewriting https://example.com to https://www.example.com but it just does nothing.
Actually, I found out that WHATEVER I put in "Additional directives for HTTPS" will only be executed if:
1.- the connection is on https protocol (ok)
2.- the url starts with "www." (not ok, I precisely need to add www. if missing)
Please help
OS: CentOS Linux 7.2.1511 (Core)
Plesk version: 12.5.30 Update #27
My ssl certificate is for www.example.com
Using the "Additional directives for HTTP " text area in plesk, I can redirect http://example.com and http://www.example.com, both to httpS://www.example.com.
I also want to redirect https://example.com to https://www.example.com
But the "Additional directives for HTTPS" text area is apparently not working. I fill it with:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI}
Checked it was actually wrote to the vhost_ssl.conf, and restarted apache.
As far as I know this should be rewriting https://example.com to https://www.example.com but it just does nothing.
Actually, I found out that WHATEVER I put in "Additional directives for HTTPS" will only be executed if:
1.- the connection is on https protocol (ok)
2.- the url starts with "www." (not ok, I precisely need to add www. if missing)
Please help