: Browser shows IP address instead of my domain name when using Google Cloud I recently bought a domain name from GoDaddy. I have a web server running in Google Cloud with a static IP. In the
I recently bought a domain name from GoDaddy. I have a web server running in Google Cloud with a static IP. In the DNS configuration in GoDaddy, I added an A record (@ -> To the static IP of the Google Cloud server) and also a CNAME record for www to point to @ .
When I go to my_domain_name.com (or my_domain_name.com), I can see my website with no issues. However, the browser shows the IP address instead of my_domain_name.com. Almost all posts on the internet suggest that I add an A record, which is already added in my case.
Update:
Here is what I get when I issue curl -I mydomain.com:
HTTP/1.1 302 Found
Date: Thu, 29 Jan 2015 08:47:43 GMT
Server: Apache/2.2.22 (Debian)
X-Powered-By: PHP/5.4.36-0+deb7u3
Set-Cookie: osclass=j20ouo6i8lvmmu88rf68j6clp7; path=/; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: 130.211.241.199:/ Vary: Accept-Encoding
Content-Type: text/html
And this is the content of my .htaccessfile.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
More posts by @Gloria169
2 Comments
Sorted by latest first Latest Oldest Best
Are you running just the one site from Google Cloud? If you're using the default Apache config, on some distros it will set up one virtual host using the IP address as the name. Any other requests would be then diverted to that default virtual host, hence you end up at your IP address.
If you type in your domain, and it ends up on your IP, then that means it's being redirected. Look for a .htaccess file or a setting in Google cloud which is redirecting it. Perhaps Google cloud needs to be told what domain it will be serving for your IP? Use curl -I example.com to see the headers and redirects
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.