Scot Ranney • December 19, 2023
htaccess www httpsThis is the better way to force www and https. The miva way of combining it doesn't work right:RewriteEngine OnRewriteCond %{HTTPS} off# First rewrite to HTTPS:# Don't put www. here. If it is already there it will be included, if not# the subsequent rule will catch it.RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]# Now, rewrite any request to the wrong domain to use www.# [NC] is a case-insensitive matchRewriteCond %{HTTP_HOST} !^www\. [NC]RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
mvkb_htaccess