• Article for your preferred language does not exist. Below is international version of the article.

Article ID: 117346, created on Sep 18, 2013, last review on May 10, 2014

  • Applies to:
  • Operations Automation

Question

Is it possible to make a website http://<DOMAIN_1> automatically redirect to a website http://<DOMAIN_2> just by creating CNAME record?

Answer

It would be possible to make a website http://<DOMAIN_1>/ redirect to a website http://<DOMAIN_2>/ only by means of CNAME record if the website http://<DOMAIN_2> is running on exclusive IP address.

In case of shared IP address it is not possible to make a website http://<DOMAIN_1>/ redirect to a website http://<DOMAIN_2>/ just by means of DNS due to web server design. In two words - the 'Host' header will not allow to achieve the goal in case website http:/// is using shared IP address (name-based hosting).

For example, refer to the following Apache documentation for more details: Name-based Virtual Host Support.

Let's say you want to set up CNAME record for <DOMAIN_1> to point to <DOMAIN_2>.

When someone opens the website http://<DOMAIN_1>/ in their browser the following actions will happen:

  1. The <DOMAIN_1> is the alias for the <DOMAIN_2> so HTTP request will be sent to the IP address of the <DOMAIN_2>.
  2. IP address of the website http://<DOMAIN_2> is shared IP (which means that many sites share it and web server uses the 'Host' header to process incoming HTTP requests).
  3. HTTP request will contain the 'Host' header of the website http://<DOMAIN_1> because it was opened in browser.
  4. Web server will accept HTTP request as request for the website http://<DOMAIN_1>/ and will check own configuration for Virtual Host with the 'Host' header of the website http://<DOMAIN_1>.
  5. Web server will not find any Virtual Host for it and will display the default domain page (Web server only knows about the website http://<DOMAIN_2>).

To correctly redirect website you can use the following ways:

  1. Assign the 'Standard Forwarding Domain Parking' hosting type to the <DOMAIN_1> in POA and forward it to the website http://<DOMAIN_2>/.

  2. Assign the 'Frame Forwarding Domain Parking' hosting type to the <DOMAIN_1> in POA and forward it to the website http://<DOMAIN_2>/.

  3. Use the 'Domain Aliases' feature in POA to create domain alias correctly.

    Note: in POA 5.4 the 'Domain Aliases' feature works only in the Linux Shared Hosting Standard service and does not work in the Linux Shared Hosting NG service. In POA 5.5 it should work in both services.

  4. Assign web hosting to the <DOMAIN_1> and use the .htaccess or some custom HTML/PHP code to redirect to the website http://<DOMAIN_2>/.

Search Words

redirect

cname

website

name-based hosting

caea8340e2d186a540518d08602aa065 5356b422f65bdad1c3e9edca5d74a1ae e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF