Redirect OLD site to NEW using htaccess

To redirect old site to new url using .htacces, use following

RewriteCond %{HTTP_HOST} ^old-url.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.old-url.com$
RewriteRule (.*)$ http://www.new-url.com/$1 [R=301,L]

Redirect with SSL verification

RewriteEngine On
RewriteRule ^(.*) https://new-url.com%{REQUEST_URI} [R=301,NC]
RewriteRule "(^|/)\.(?!well-known/)" - [F]

See htaccess

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *