MyBB Community Forums

Full Version: Ip address instead of domain name
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello everyone!

Why Google shows also my ip address in place of domain name in search results?

Example of my website: https://xyz.com
Google shows it also like http://112.112.112.2.

Should i change something in my .htaccess file which looks like this?

RewriteCond %{HTTP_HOST} ^www.xyz.com [NC]
RewriteRule ^(.*)$ https://xyz.com/$1 [L,R=301,NC]
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Thanks in advance.
did you set DNS configuration?
also
Use 301 permanent redirect to redirect the IP to the domain name.
Where should i set it? In the cpanel?

I'm using cloudflare, so i checked the DNS Mangement for my website and the second option in the screeshot was not proxied.

I have set it to proxied now. I will see if the problem presists. (After 24 Hours)

Thanks for your help.

[attachment=45804]
Google would only be indexing the site by IP address if there's links to it somewhere.
Yeah, i have just read this also.

So, what could be the possibile solution?

[attachment=45805]
Set a redirect in cPanel. To be honest the server shouldn't really be configured to serve the site directly from the IP address in the first place, not something you should usually need to worry about.
Should i claim it to the hosting company?
You can probably ask them about it yeah. It shouldn’t really be serving the site like that.
Hello everyone!

So here is the reply from the hosting company.

"Sir, We are getting the proper domain name in google while searching.
Sir, We can see that you have taken the self-managed VPS. Its not possible for us to provide extended support."

Is there someone who uses a self managed VPS and who can suggest me where to look at?

Thanks a lot.
I am not familiar with google seo requirements, neither do I use cloudflare system, so this may not apply to your circumstance.

But I have found this htaccess test resource valuable at https://htaccess.madewithlove.com/

Adding two lines to your example code provided above, as suggested by Mostafa.Shiraalli, seems to work properly.
RewriteCond %{HTTP_HOST} 112.112.112.2.com [NC]
RewriteRule ^(.*)$ https://xyz.com/$1 [L,R=301,NC]
RewriteCond %{HTTP_HOST} ^www.xyz.com [NC]
RewriteRule ^(.*)$ https://xyz.com/$1 [L,R=301,NC]
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

My self-managed VPS is with a different host, and although they (and I) understand the "cannot provide extended support" provision, I can usually get an answer to "can you please give me a direction to investigate further." They do provide paid support per incident upon request.

And no, I cannot get any results at all by using my IP address instead of domain name.
Pages: 1 2