This means your website is accessible through domain and IP, both of which could cause duplicate content if the search engine indexes both URL and IP. Duplicate content is not good for SEO, and this is something you should fix it immediately if found. In this article, I will talk about how to test and fix IP canonical problems in Nginx and Apache webserver.

Test IP Canonicalization

You can either access your IP address manually to check if it’s getting redirected or use the following online tools to test.

SEMrush SEOMator Woorank

Fix IP Canonical issue in Nginx

Login to your Nginx server. Take a backup of nginx.conf file Create a new server block like below

Very obvious, you have to change the IP and domain name with yours. Restart Nginx, and you are all good now.

Fix IP Canonical issue in Apache

Login to your Apache server Take a backup of httpd.conf file Ensure mod_rewrite is enabled

Add following Rewrite rule

Make sure you change 128.199.100.xxx to your actual IP. This is one of the hundreds of SEO metrics, and if interested in more, you should analyze your website for SEO.

Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 30Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 44Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 38Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 69Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 82Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 47Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 11Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 92Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 81Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 36Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 43Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 86Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 34Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 74Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 16Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 37Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 21Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 15Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 11Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 51Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 76Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 76Redirect IP request to Domain URL   Test and Fix IP Canonical Issue - 94