If you know IP address of your website then enter it in a browser. Does it load your website with the IP address? Then be careful, your server IP is not forwarding to your website’s domain name. IP should redirect to your website’s URL or to a page from your website hosting provider. Search engines like Google are now able to index your website with its IP instead of its domain name. This will result in duplicate content.
So to avoid the problem of duplicate content you should do an htaccess 301 redirect to make sure the IP does not get indexed.
This can be achieved in Nginx by changing the default vhost configuration.
sudo nano /etc/nginx/sites-available/default
Add the following code at the top of the above file.
server { listen 80 default_server; listen [::]:80 default_server; server_name _; return 403; }
Then restart nginx.
sudo service nginx restart
Similarly, in apache you should paste the following code at the end of the .htaccess file
RewriteCond %{HTTP_HOST} ^123\.345\.567\.789 RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Replace your IP with the numbers and example.com with your domain name.
Now check again with the IP. You should see a redirect.
13 responses to “No IP Canonicalization may harm Website Ranking”
I have deleted the droplet. Now? What should I do?
Now, I am using Shared Hosting from Namecheap
Then use .htaccess method which has been described in this post.
This will work? How much time will this take?
Its not working from google search check this IP
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
RewriteCond %{HTTP_HOST} ^162\.243\.41\.208
RewriteRule (.*) https://xtremetricks.net/$1 [R=301,L]
When i try hitting http://162.243.41.208/ it is going nowhere. That is a good thing. Google will not index this ip address. You can check this only after deleting your browser cache.
Yes, Google removed that link. Now, my another question in Google my posts are of two types
https://Www.mysite. Com
https://Mysite. com
This is good or bad?
You should not have these two types i.e. www and non-www mixed. Maintain any one of the two and stick with it.
In Google its showing both what should I do now?
you should redirect www to non-www domain or vice-versa.
check this: https://easyengine.io/tutorials/nginx/www-non-www-redirection/
I am using Shared Hosting 🙁 of Namecheap
Do you have root access (command line)?
NYC POST, may i know diff between www nd non www webstite , which one is recommended for ranking
non-www version: https://wbxpress.net
www version: https://www.wbxpress.net
we prefer non-www version.