Re: Secure Web Site

by shoulders » Sat Oct 15, 2022 3:07 pm

All is working well. I no longer use http on my websites so I use the following to get rid of any old links.

Code: Select all

RewriteEngine On

## If https is off
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

## Redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]