How to redirect non-www to www with .htaccess – Come redirigere non-www to www tramite .htaccess

How to redirect any requests from to There are several benefits from doing that:

Applied to: Linux apache.

Log on your server and tries on website folder the .htaccess file and edit it:

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

Well done!

Best Regards,
ITquadro – specialized Blog

ITquadro sistemisti specializzati su Bologna ed Emilia-Romagna esperti in installazione e configurazione di server apache su distribuzioni linux basate (Debian, CentOS, ecc).