Nulledin Posted February 14, 2023 Posted February 14, 2023 Redirect to https without www: # Canonical HTTPS/non-WWW <IfModule mod_rewrite.c> RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] RewriteRule (.*) https://example.com/$1 [L,R=301] </IfModule> Redirect to https and www: # Canonical https/www <IfModule mod_rewrite.c> RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule (.*) https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule> Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.