• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • 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.

Issue Get WWW and HTTPS Redirects working together for HSTS Preload

LRLD

New Pleskian
Hi,

can Plesk please fix these two so they work properly together and you can add your domains to the hsts preload list.
It would be very easy to fix, simply remove the www redirect from the http section so it only gets added to the https section.

http://domain.com doesn't need redirecting to http://www.domain.com, it just needs to be redirected to https://domain.com and then redirected to https://www.domain.com.
At the moment, I have set preferred domain to none, and have put the www redirect in the Additional directives for HTTPS in Plesk and added my domain to the preload list.

I hope this can get fixed soon, it's obviously been a while!
Kind regards

LD
 
Hello, @LRLD. There's an existing UserVoice idea for improving this behavior. Please consider voting for it here to increase its popularity. We are glad to hear you already found a workaround to the issue, just for the sake of the rest of the users who might come across the undesirable redirect, it's possible to either change the preferred domain settings or manually add HSTS header to location / of the domain's Nginx vhost file. Use the server { section where it's assigned to :80. For example on /etc/nginx/plesk.conf.d/vhosts/example.com.conf:

CONFIG_TEXT:server {
listen 203.0.113.2:80;
...
...
...
location / {
return 301 https://$host$request_uri;
add_header strict-transport-security: max-age=15552000;
}

I hope that helps.
 
Back
Top