Does pointing a URL via CNAME to another domain redirect via endpoint?

Does pointing a URL via CNAME to another domain redirect via endpoint? - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the Does pointing a URL via CNAME to another domain redirect via endpoint? error on your web browser. Problem :


We have test1.example and we are going to shut that down on server 1.


On server 2 we have test2.example. We are going to assign the CNAME of test1.example to test2.example.


After doing so if someone goes to test1.example/subdirectory/index.html go to test2.example or test2.example/subdirectory/index.html?


Solution :

A CNAME is not a redirect. When you use a CNAME, the traffic for both domains is sent to the same IP address. The behavior of the site that users see when you use a CNAME record is identical to what users see when you use an A record with the IP address of the other server. The type of DNS record you use has no bearing on how your site behaves. You can't cause redirects with DNS alone.


It is up to the webserver how to handle traffic for two different domains. The webserver gets sent the host name for each request. The webserver can choose to:



  1. Show the same content for both domains

  2. Show different content for each domain

  3. Show content for one domain and redirect the other domain

  4. Show error messages for one or both domains.


Implementing a redirect for a domain is done through webserver configuration. You don't say which webserver software you are using, so I will just give general instructions. You have to set up two sites or virtual hosts one for each host. Then you need to configure one of them to redirect. That is usually a one line configuration option. For example in Apache, the virtual host configuration for the old site might look like


<VirtualHost *:80>
ServerName test1.example
Redirect / http://test2.example
</VirtualHost>

When you configure the redirect, you can choose to redirect to deep URLs or redirect everything to the home page. The Apache configuration shown above does deep redirects. It is almost always better to redirect to deep URLs. It hurts SEO to redirect to the home page of the new site and it confuses users.


We hope that this article has helped you resolve the redirects, dns, cname error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=