Working with Modx 2.8.3, I added these instructions to the .htaccess file to have all page requests be redirected to “www.”
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteCond %{HTTP_HOST} (.+)$
RewriteRule ^(.*)$ https://www.%1/$1 [R=301,L] .
RewriteCond %{SERVER_PORT} !^443
RewriteRule (.*) https://mysite.com/$1 [R=301,L]
It works flawlessly for the website itself (e.g. mysite.com) but not for modx manager, e.g. mysite.com/manager → www.mysite.com/manager
The problem is, when calling the manager without preceding “www.”, it does not work properly. I then have to manually add “www.” to the domain and then have to login once more. Why does the www. redirect not work for /manager?