Blog Loop links to /articlexyz/index.html instead of just /articlexyz

Hey!
I’m a big fan of the new blog loop feature!
However, I’ve noticed that the loop elements link to the /index.html pages of each article instead of just linking to the main folder that contains the index.html.

This is a problem for SEO, because now there are two different URLs for the same blog post, for example:
https://one-sec.app/blog/how-to-avoid-reality-online/index.html
and
https://one-sec.app/blog/how-to-avoid-reality-online/

Does anyone know how I can change the behavior of the blog loop linking?

This is the website in question: one sec app | Blog

Thanks a lot for your help!
– Frederik

It appears you’re hosting this yourself, am I correct?

Is your server Nginx or Apache?

It’s hosted on Google firebase (static site)

Firebase does websites now too? Jeez…

So, I was going to suggest you setup some rewrites for your URLs, I know how to do that with Apache, but Googles system is proprietary.

You can read about it here.

It doesn’t seem overly complex, my best guess is something like this would work:

{
  "hosting": {
    "public": "public_html",
    "cleanUrls": true,
    "rewrites": [
      {
        "source": "/blog/**",
        "destination": "/blog/index.html"
      }
    ]
  }
}

This would remove the index.html from the URLs.

It’s just one solution, I’ve still not used the blog loop components so I can’t confirm if this is the expected behaviour of the URLs

Thanks for the hint!

I’d like a proper solution for this though, the Blog Loop generates the links pointing to the /index.html pages.

This is a good suggestion. Currently blog loop always links to the HTML file path. We will add a special case for index.html files and link to their parent folders instead.

3 Likes

Nice thanks a lot!
Until this is shipped, is there any workaround?