Avoid duplicate content index.html. Canonical url or redirect index.html?

Hello the community,

Need help for my static website deployed with Netlify www.seo31.fr. When I crawl it with Screaming frog, I have this common issue: duplicate content between index.html and my root folder. What is the best solution for you:

  1. canonical url on the index.html ?

  2. redirect index.html to root ?

In the 2 case, how you redirect it to root ? I tried this but it didn’t work:

/index.html /*

Tx for your help :slight_smile:

/ is same as /index.html. Modern browsers automatically display an index.html present inside a folder. This is not just true for the home page, but any page. Instead of having pages like /about.html, people use /about/index.html and link to that page as /about/. The browser automatically serves /about/index.html and displays /about/ in the address bar. So, you don’t really need to mention anything I would say, but if you have to (just like you said, for SEO purposes), canonical is what you’re looking for.

The redirect rule you tried is not of much use here. However, if you were to use redirects (for some other purpose than the problem mentioned in this thread), remember that * stands for a wildcard entry, that is everything matching the path before the *. Thus, you can’t use it as a destination, but only as a source.

Thank you so much for your great answer @hrishikesh, ok fine I understand better. So I decided to use canonical. But i will follow rules as you mentioned for redirections. A big hello to India :slight_smile: