Redirecting to a single domain

If your website is running under several domain names, it is recommended to choose one main domain and make the redirection from other domains to the selected one. Place this part of the code at the beginning of your PHP script.

$http_host = @$_SERVER['HTTP_HOST'];
$req_uri   = @$_SERVER['REQUEST_URI'];
if (
strlen($http_host) > 0
&& strcasecmp($http_host$redirect))
header('Location: http://$redirect$req_uri');

The main advantages of this solution are mostly within the area of Search Engine Optimization (SEO):

  • the same content is placed on a single website (domain), what most browsers really like;
  • Google PageRank value is not divided between several pages, but rather "summarized" together for the one main page;
  • as a result of these steps, indexation of your website should improve as well as its ranking in search engines.

Solution using the .htaccess

You can solve this problem using the .htaccess file as well.

Redirect from www to non-www:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^ %{REQUEST_SCHEME}://%1%{REQUEST_URI} [R=301,L]

Redirect from non-www to www:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ %{REQUEST_SCHEME}://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


we are ready to serve

currently online

agents online 2 / 6

Platon Technologies

How can we help you?

We accept reports of problems or other inducements related to the use of our products and services. +421 222 111 321

In case you need any help, contact us by e-mail or by phone.

  • On the phone from 8:30 - 17:30
  • Sometimes even on weekends
  • Simple human approach
  • Complex problems solving
contact form

Give a chance to our online help-center. You can find there more than:

  • 6 categories
  • 59 manuals
  • 23 e-mail settings
  • 7 programming tips
go to counseling

Questions about our products or any specific request? Contact us.

Thanks for message

If necessary, we will contact you.

Send of message failed

Please contact us at


Subscribe to receive our news and current offers

Thanks for your subscribe

Subscribtion has failed