Answers for "Redirect to HTTPS & remove www"

PHP
0

Redirect to HTTPS & remove www

RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
Posted by: Guest on June-30-2021

Code answers related to "Redirect to HTTPS & remove www"

Browse Popular Code Answers by Language