4

Let's assume I have website example.com and 1000s of inner pages.

Is there any difference in terms of SEO ranking (SERP) when I link to my home page from all the inner pages using "/" and "example.com" ?

In my Google Webmaster Tool (Search Console), Search Traffic -> Internal Links I see around 1000s of internal links pointing to my domain "www.example.com", I hope it should be displayed as "/"

My concern is, if Googlebot thinks that these internal links are pointing to some other pages rather than actual home page, then the 1000s of internal links weightage will go to some other page.

2
  • Google is going to do a better job than that. However you are needlessly pushing more bytes to the client and depending on the content management system's opinion of how to best address the FURL issue - needlessly growing db size as well Commented Dec 8, 2015 at 6:46
  • Has been asked in various forms already: relative path vs absolute. Commented Dec 11, 2015 at 0:19

2 Answers 2

4

There is absolutely no difference for SEO when you create your links as relative or absolute:

  • <a href="/">Link</a>
  • <a href="http://example.com">Link</a>
  • <a href="http://example.com/">Link</a> (for the home page, the trailing slash doesn't matter.)

Google knows that all of those point to the home page. It will assign value to them appropriately and list them all the same in Webmaster Tools.

On the other hand these are not equivalent:

  • <a href="example.com">Link</a> -- Points to http://example.com/example.com because it is interpreted as a relative link (it is missing the http:// and is a broken link.)
  • <a href="/index.html">Link</a> -- While index.html may be the file that contains the home page content, http://example.com/ and http://example.com/index.html are different URLs that could be configured to have different content. It is better not to use index.html in any links on your site.
1

Google is smart enough to assign the correct link juice to the homepage for any variation that lands a bot or user back at the homepage.

However, if you are still concerned about internal links to your default page being recorded as different links then

  • Add redirects: check your Google analytics & Search Console for any such variations for links to the homepage, and adding a redirect to "/"

For the common ones, using .htaccess to do this, you can use:

RewriteRule ^(.*)index\.(php|html?)$ /$1 [R=301,NC,L]

It redirects URIs ending with index.php, index.htm or index.html to / and works with subdirectories, too. The NC flag means it is case-insensitive (works for both upper or lower case).

  • Specify the root file in Google Analytics under Site profile settings eg. index.php as being the file that is equivalent to "/". It can't hurt to set this, in fact it should combine all your hompage accesses together, and though there is no hard evidence to suggest this has any relevance to your PageRank, it wouldn't be there if it didn't help Google to better index and display your site, so I feel it is worth mentioning.
1
  • I think your rewrite rule can generate problems. A page such as here-index.php would also be converted to /. Not automatically a bad thing, but it's not just index.php, index.htm, or index.html that will be redirected. To make sure it's only a path before, something like this would work: ^(?:(.*)/)?index\.(php|html?)$ Commented Mar 20, 2018 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.