Can I make any page homepage from a post or any folder?


I’m looking for a way to set any page suppose a post or any other custom page except index.html as the home? I know I can do in that specific page front-mater like but not ideal as permalink is changing:

# my problem is that it'll change the permalink not good for SEO
permalink: "/"

I also found a plugin jekyll-redirect-from but I’m not certain about how it’ll affect and work.

My need is preferably from main _config.yml or from front matter of the post (or other page maybe , I can set the desired page as homepage.


I don’t see a problem with setting any page to have / for permalink. Provided there is no page already at the root of your repo.
GitHub Pages might use your as root. Maybe

I don’t see an seo problem. The output of Jekyll will give you /index.html which can be seen as /. Google doesn’t know or care that it was or a post in your repo.
Yes if subpage /foo.html becomes / then Google will see the page as missing and remove it from search results (good. To prevent user errors). And Google will find the content on /. If you are really concerned then use redirect plugin to send people from old path /foo.html to /.

Using redirect as a main solution will possibly be a SEO issue because your / page will immediately redirect a user or crawler to /foo.html

Which adds a time delay, it adds a redirect on an important page and it makes it impossible for a user to go to your / page if they enter it manually.

What is the aim of what you are doing and why? It sounds like you are fighting against the system and should rethink what your overall goal is.
If your subpage is that important, why not move it to And then the original or post can have friendly message and link or a auto redirect to /.

You can also use a snippet of a page or post on homepage using extract filter.

I do that on my blog Home | Coding Blog

1 Like

Thanks for replying. I think yes redirect can solve and for me server redirect is better than jekyll plugin etc.

Final decision was setting permalink in frontmatter

permalink: "/"
1 Like