How to redirect non-WWW to WWW using .htaccess?

Add the following code to your .htaccess file:

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






Show Form
No comments yet. Be the first to add a comment!