Answers for "htaccess code to redirect non www to www"

0

redirect htaccess non www to www

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Posted by: Guest on April-14-2020
0

htaccess redirect non www to www https

# Redirect to HTTP non-www to HTTPS www htaccess

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
Posted by: Guest on February-08-2021
0

redirection on non www to www htaccess

# 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>
Posted by: Guest on July-15-2021

Code answers related to "htaccess code to redirect non www to www"

Browse Popular Code Answers by Language