Lab Hack: Apache URI purgatory
To HTTP or to HTTPS, that is the question. This lab hack takes me deep into the domain.conf which controls all the VirtualHosts *:80 and VirtualHosts *:443 entries.
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST| ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]
This was the previous entry, lets cross our fingers that it works
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.draftfriend.com [OR]
RewriteCond %{SERVER_NAME} =draftfriend.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
After a good restart of apache the test url target seemed to play nice. Food for thought.