1

I recently (4 weeks or so ago) launched a food recipe website and have been getting Google to index the pages by submitting an updated sitemap and requesting it to index specific pages with some success. However, recently GSC has decided that the homepage - index.html is a duplicate of another, which is very strange, because the home page is far different from any other page on the site. The only similarity to other pages are two photo's at the bottom of the page that point to the respective recipes.

The thing that is baffling me most is that the website URL https://www.example.co.uk/ is of course https://www.example.co.uk/index.html

So, could someone please explain why Google Search console is saying that https://www.example.co.uk/index.html is:

Duplicate without user-selected canonical

while at the same time https://www.example.co.uk/ is indexed correctly

This is the first website that I have asked Google to index, so my knowledge on GSC is not so great. Doesn't GSC know that https://www.example.co.uk/ is https://www.example.co.uk/index.html? It seams a little discombobulating to me!

One thing I have noticed is that https://www.example.co.uk/.index.html is not specifically named in the site map:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>https://www.example.co.uk</loc>
        <priority>1.00</priority>
        <lastmod>2023-12-03</lastmod>
    </url>
    <url>
        <loc>https://www.example.co.uk/beef-curry-with-green-beans.html</loc>
        <priority>0.50</priority>
        <lastmod>2023-12-03</lastmod>
    </url>
    <url>
        <loc>https://www.example.co.uk/basmati-rice.html</loc>
        <priority>0.50</priority>
        <lastmod>2023-12-01</lastmod>
    </url>
    ...
</urlset>

PS: I'm using the 'Sitemap Generator by Nils Soderman' extension within VS Code to generate the site map.

1 Answer 1

1

It is a duplicate URL. /index.html is the exact same content as /. Google doesn't want to index both, so it detects that they have the same content and chooses one.

Google says "without user selected canonical" because you are not using canonical link tags in the <head> section: <link rel="canonical" href="https://www.example.co.uk/"> that would unambiguously tell Google which one you prefer as your canonical URL.

There are two reasons that Google is selecting the one without index.html to index:

  • You list the one without in your sitemap. Google uses your sitemap as a canonicalization signal when you don't use tags.
  • index.html is supposed to be hidden. Ideally users and search engines are never supposed to know it exists.

If you added canonical tags to your site. Google would change the messaging to say that it detected the duplicate URL and chose the user-selected canonical.

To that last point, you should check your pages and make sure that you aren't linking to index.html anywhere on your site. You should always link to your home page with links that don't have it using links like:

  • absolute: <a href="https://www.example.co.uk/">
  • root relative: <a href="/">
  • document relative (not recommended because it will be different for different documents based on their directory depth): <a href="./"> or <a href="../"> or <a href="../../">
4
  • Ah! The navigation menu has a link to example.co.uk/.index.html whereas you are saying that it should link to example.co.uk if I understand you correctly. Could this be the issue?
    – Fishbite
    Commented Dec 5, 2023 at 12:54
  • 1
    Yes, your navigation menu should not use index.html in the link. Commented Dec 5, 2023 at 13:11
  • I was not aware of this fact. I wrote a little program that puts the nav menu together for each page & I have corrected this now, and by what you are saying, I should not request that google index the index.html page. Am I correct in that?
    – Fishbite
    Commented Dec 5, 2023 at 13:25
  • No, index.html is for behind-the-scene use. You want to have content on the home page. Content has to go in some file. The convention is to use index.html to contain the content for the directory index. It should never publicly appear in your URLs. Commented Dec 5, 2023 at 13:29

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.