SGIS news

Force www in URL

We’ve put this quick guide together as we have had a number of request recently on how to force www to the URL. For example, if someone enters they will be redirected to This is important as it avoids search engines indexing duplicate content for your website as the same content could be listed both on and

Some CMSs, such as WordPress, take care of this for you but if you’re CMS or website doesn’t do this as standard we have included instructions and code below to force www.

1. Open the public_html folder on your hosting account.
If you already have a .htaccess file in the public_html folder please open it and go to step 3 – please make sure to backup your .htaccess file before attempting any changes.

2. Click on the create new file button and enter .htaccess as the file name.

3. Paste the below code into the text area and hit save.

# Turn on the Rewrite Engine
RewriteEngine On
RewriteBase /

# Force www
RewriteCond %{HTTP_HOST} ^
RewriteRule (.*)$1 [R=301,L]


N.B. Please remember to replace with your actual web address.

4. Test the change by entering into your web browser and you will be redirect to

If you have any questions please contact support.