Select Page

Add this line of code in your .htaccess

Redirecting example.com to www.example.com

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.com [nocase]
RewriteRule ^(.*) http://www.example.com/ [last,redirect=301]

Redirecting www.example.com to example.com

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com [nocase]
RewriteRule ^(.*) http://example.com/ [last,redirect=301]

Pin It on Pinterest

Share This