No IP Canonicalization may harm Website Ranking


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”

  1. 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]

Leave a Reply

Your email address will not be published.