How to set up redirection to a domain WITHOUT a ‘www’ prefix?

In the hosting control panel

How to open the hosting control panel

  1. in the Domains section click on Redirects;
  2. select the necessary domain in the drop-down list. Tick the checkbox ‘Redirect from www only’. In the ‘redirects to’ field, specify your domain with an ‘http://’ prefix.
  3. Click Add to add a redirect.

Using the file .htaccess

Proceed to your website root directory and add the following lines to the file ‘.htaccess’ (please mind the dot in the beginning of the filename):

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

where site.com is your domain name.

If .htaccess does not exist yet, just go ahead and create it.