Disable the www subdomain on a domain

In your Apache configuration or in a .htaccess file:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 

Tip from the no-www website.

Categories: Apache