How to redirect www to non-www URL using htaccess

redirect www to non www url htaccess

To redirect all www traffic to non-www URL – you need to add the following lines in .htaccess file:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^ [NC]

RewriteRule ^(.*)$$1 [L,R=301]

Replace with your own domain name.

Leave a Reply

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