Redirect for subdomain not working in GoDaddy. CNAME in place, but getting 404

Redirect for subdomain not working in GoDaddy. CNAME in place, but getting 404 - 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 Redirect for subdomain not working in GoDaddy. CNAME in place, but getting 404 error on your web browser. Problem :


After reading:





I am facing some problems when trying to redirect a subdomain to another subdomain. Here is the network infrastructure:




  • I have a CNAME registred in uolhost.com called mysubdomain1.mydomain1.com;

  • the CNAME (mysubdomain1.mydomain1.com), is pointing to mysubdomain2.mydomain2.com, which is hosted by GoDaddy;

  • When I use the ping command on mysubdomain1.mydomain1.com, I see that the redirection is working just fine, pointing to the IP of mysubdomain2.mydomain2.com;

  • When I type into my browser mysubdomain2.mydomain2.com, the correct site is shown;

  • But when I type mysubdomain1.mydomain1.com, I get a 404 error from GoDaddy;



Seems that they are working with more then one site per host, and the subdomain don't get properly resolved.



GoDaddy suggested to create a 301 redirect, but this will show that the user has been redirected in the browser.



I want any solution that masks the mysubdomain2 as mysubdomain1, is that possible?


Solution :

The problem here is that GoDaddy provides you a virtual host for DNS name mysubdomain2.mydomain2.com.



When you try to enter the site with mysubdomain1.mydomain1.com, the browser first makes a DNS lookup for the domain name. The lookup results in CNAME record telling to look up IP address for mysubdomain2.mydomain2.com, and make the request there.



The web browser doesn't change the virtual host it is requesting based on the result of DNS lookup.



So, what happens here is that your browser opens TCP connection to the GoDaddy web server, and asks for mysubdomain1.mydomain1.com from the site. GoDaddy replies with 404, since no such site is there.



There are a couple of ways to achieve what you want:




  1. Ask GoDaddy to add mysubdomain2.mydomain2.com virtualhost to their webserver, pointing to the same directory as mysubdomain1.mydomain1.com. I don't know if GoDaddy does these kinds of things, as it is kind of special.


  2. Configure a webserver at separate place for mysubdomain1.mydomain1.com, and make it reverse proxy requests to GoDaddy's server.



We hope that this article has helped you resolve the redirects, subdomain, godaddy 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=