Mobile app version of vmapp.org
Login or Join
Cody1181609

: IP canonical URL issue So I did a search engine optimization test today and one thing it came back with was: Your site's IP XX.XXX.XXX.XX does not redirect to your site's domain name.

@Cody1181609

Posted in: #CanonicalUrl #IpAddress #Redirects

So I did a search engine optimization test today and one thing it came back with was:


Your site's IP XX.XXX.XXX.XX does not redirect to your site's domain name. This could cause duplicate content problems if a search engine indexes your site under both its IP and domain name. Consider using a 301 re-write rule in your .htaccess file so that your site's IP points to your domain name."


I have looked but I can't seem to find a clear answer on how to do this, I need to know what I would put into the .htaccess file? There was something over at Stack Overflow but I'm not sure that's right.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Cody1181609

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ann8826881

This warning is innocuous since IP addresses can serve multiple hosts and are not expected to redirect to one particular domain.

Prior to being concerned with this, you should first check if accessing the IP address even returns the same content as your domain. Even if it does however, search engines like Google will not penalize your site for duplicate content unless it appears to be spammy (e.g., intentionally scraping site content from another site), as indicated here:

Cutts on similar website content, multiple domains: Duplicate or safe?

10% popularity Vote Up Vote Down


 

@Berumen354

You probably want something like this depending on what your canonical URL is:

Options +FollowSymLinks
RewriteEngine on
# Redirect IP/non-canonical domains
RewriteCond %{HTTP_HOST} ^example.com [OR]
RewriteCond %{HTTP_HOST} ^11.22.33.44 <-- Server IP here.
RewriteRule (.*) www.example.com/ [R=301,L]


You may already have something similar in your .htaccess if you redirect www -> non-www or vice versa.

edit - please remove the <-- Server IP here once you insert your own server IP.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme