0

The site loads at http://magento.ngstorefront.com but the url changes to http://35.193.85.53 . Siteground support says we need to manage this in Google Cloud DNS and not through them. How can we make the url not to change to IP address?

Details:

Google Cloud VM --> http://35.193.85.53 (Static IP.. site loads at this url)

Our main domain ngstorefront.com is hosted on Siteground.com

To make the subdomain http://magento.ngstorefront.com point to 35.193.85.53 , we added A and CNAME records in Siteground as:

magento.ngstorefront.com.   A   35.193.85.53
www.magento.ngstorefront.com.   CNAME   magento.ngstorefront.com  
Suren Konathala
  • 3,497
  • 5
  • 43
  • 73

1 Answers1

0

Siteground is wrong.

One of the jobs of DNS servers convert DNS names to IP addresses.

Your web server is redirecting. Use curl to prove this to your vendor.

This is a simple configuration file fix.

Further down in my answer notice the 302 returned by your web server. Notice Location: http://104.197.44.78/index.php/?SID=fmn3h9n2qjhjplchl1070rgff6

Your webserver is redirecting http://magento.ngstorefront.com to http://104.197.44.78/index.php/?SID=fmn3h9n2qjhjplchl1070rgff6

Run this command to repeat:

curl -i http://magento.ngstorefront.com

The returned output:

HTTP/1.1 302 Found
Date: Thu, 14 Mar 2019 20:20:24 GMT
Server: Apache
Set-Cookie: store=default; expires=Fri, 13-Mar-2020 20:20:24 GMT; Max-Age=31536000; path=/index.php/; HttpOnly
Set-Cookie: PHPSESSID=fmn3h9n2qjhjplchl1070rgff6; expires=Thu, 14-Mar-2019 21:20:24 GMT; Max-Age=3600; path=/; domain=magento.ngstorefront.com; HttpOnly
Expires: Wed, 14 Mar 2018 20:20:24 GMT
Cache-Control: max-age=0, must-revalidate, no-cache, no-store
Pragma: no-cache
Location: http://104.197.44.78/index.php/?SID=fmn3h9n2qjhjplchl1070rgff6
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Content-Length: 0
Content-Type: text/html; charset=UTF-8
John Hanley
  • 74,467
  • 6
  • 95
  • 159
  • We had to assign a new server while trying.. so the new IP is 104.197.44.78 . But either way, is this something we have to manage in web server (Apache) on Google Cloud VM? If so, how can we do it? I'm trying to update the "hostname" of the VM to magento.ngstorefront.com – Suren Konathala Mar 14 '19 at 20:36
  • Close this question and create another one as your original question is answered. The new question should be about configuring Apache for your domain name. Include your .htaccess if your are using one and your Apache configuration files in your question. Your new question is not related to Google Cloud, just Apache. – John Hanley Mar 14 '19 at 20:41
  • To clarify, the VM on Google cloud will remain at the IP address(104.197.44.78) and there is no way we can map it to a subdomain(magento.ngstorefront.com) because Apache is controlling it? – Suren Konathala Mar 14 '19 at 21:51
  • You can configure apache to direct the users to either the DNS name or the IP address. This is just configuration options. Apache at this point is redirecting the user to the IP address. This is not what you normally want. – John Hanley Mar 14 '19 at 22:08