Answers for "how to do htaccess redirect"

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
1

https and www htaccess redirecr

RewriteEngine On
RewriteCond %{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 match
RewriteCond %{HTTP_HOST} !^www. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Posted by: Guest on July-14-2020
0

htacces redirect

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

Browse Popular Code Answers by Language