• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WBXPress.NET

Website Developement Guide

  • apache2
  • nginx
  • mysql
  • php7
  • SSL
  • wordpress
  • genesis
  • caching
  • seo

No IP Canonicalization may harm Website Ranking

Updated on 11th July 2015 13 Comments

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.

Filed Under: apache2, nginx

Reader Interactions

Comments

  1. Xaif says

    4th August 2016 at 9:30 am

    I have deleted the droplet. Now? What should I do?

    Now, I am using Shared Hosting from Namecheap

    Reply
    • wbxpress says

      4th August 2016 at 11:48 pm

      Then use .htaccess method which has been described in this post.

      Reply
      • Xaif says

        5th August 2016 at 6:55 am

        This will work? How much time will this take?

  2. Xaif says

    5th August 2016 at 8:19 am

    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]

    Reply
    • wbxpress says

      5th August 2016 at 6:46 pm

      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.

      Reply
      • Xaif says

        7th August 2016 at 11:38 pm

        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?

      • wbxpress says

        8th August 2016 at 11:19 am

        You should not have these two types i.e. www and non-www mixed. Maintain any one of the two and stick with it.

  3. Xaif says

    8th August 2016 at 1:49 pm

    In Google its showing both what should I do now?

    Reply
    • wbxpress says

      8th August 2016 at 10:41 pm

      you should redirect www to non-www domain or vice-versa.

      check this: https://easyengine.io/tutorials/nginx/www-non-www-redirection/

      Reply
      • Xaif says

        9th August 2016 at 12:22 pm

        I am using Shared Hosting 🙁 of Namecheap

      • wbxpress says

        9th August 2016 at 10:03 pm

        Do you have root access (command line)?

  4. vikrant guleria says

    3rd January 2018 at 2:41 pm

    NYC POST, may i know diff between www nd non www webstite , which one is recommended for ranking

    Reply
    • wbxpress says

      7th January 2018 at 10:51 am

      non-www version: https://wbxpress.net
      www version: https://www.wbxpress.net

      we prefer non-www version.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Most Popular Posts

  • Remove/ Defer Render-blocking JavaScripts
  • Customizing Genesis eleven40-pro Theme
  • Free Genesis Child Theme by WBXPress
  • Host Multiple Sites with SSL in Ubuntu 18.04
  • 25 Ways to Boost Website Traffic that Really Work

Recent Comments

  • Ruhul on Customizing Genesis eleven40-pro Theme
  • Priya Agarwal on Customizing Genesis eleven40-pro Theme
  • mimi roy on Remove/ Defer Render-blocking JavaScripts
  • danish choudhary on Customizing Genesis eleven40-pro Theme
  • Radhe on Customizing Genesis eleven40-pro Theme

Copyright © 2021 · Powered by WordPress · Log in