Redirect domain without www to domain with www using .htaccess 301 direct

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Here is the solution for many of you maybe searching for:

Add the following lines to .htaccess file (create a new one if it doesn’t exist).

Note: its for Linux apache environment. Change the domain url as yours.


RewriteEngine on
RewriteCond %{HTTP_HOST} ^leonli\.co.uk$ [NC]
RewriteRule ^.*$ http://www.leonli.co.uk/$0 [NC,L,R=301]

Leave a Reply

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