This page looks best with JavaScript enabled

How to redirect www URLs to non-www?

 ·  ☕ 1 min read  ·  👽 john hashim

To redirect all requests to non-www, add the following lines at the beginning of your website’s .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

Replace with your actual domain name.

Share on

john hashim
john hashim
Web Developer