Quote from: BobRay at Feb 01, 2018, 01:51 PMI looked again and this is what I actually have at my site in .htaccess:
RewriteCond %{SERVER_PORT} !^443
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteRule (.*) https://mysite.com/$1 [R=301,L]
I'm not sure where lines 2-4 came from or whether they're necessary. mysite.com should be changed to the actual domain.
Also, make sure you're editing the .htaccess file in the MODX root directory (not the core or manager) and not the ht.access file.
Be sure the code comes after these lines:
RewriteEngine On
RewriteBase /
Thanks for this Bob - appreciate you looking into it further.
So The htaccess file is inherited so I'm not 100% sure about all of it's code - but below is whatI have:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
# Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteBase /
</IfModule>
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteCond %{HTTP_HOST} !=localhost [NC]
RewriteCond %{HTTP_HOST} !=127.0.0.1
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
Then I have this:
<IfModule mod_rewrite.c>
RewriteCond %{SERVER_PORT} !^443
RewriteRule ^ https://www.domain.co.uk%{REQUEST_URI} [R=301,L]
</IfModule>
As i understand it, the first rewrite is to make sure all traffic goes via www... and the second part is supposed to ensure that https is used - but I am thinking that one is confusing the other maybe?
The code you have is very similar to the second block of my code - but I'm not sure what I should remove/add?
Thanks
Andy