How to? Blog URL = domain/blog/ & Item URL = domain/item

Hello, everybody,

I’m sure there are several ways to achieve what I want. So I want to know which way you think is the best.

What I want:

I created a blog in domain/blog This should be an overview of sites and articles I write.
The Item URL should not have “blog” in its URL. It should be like domain/item-url

My solution so far:

  1. I create the content under domain/item-url
  2. I create a dummy blog item under domain/blog/item-url
  3. I create a Route Overrides - Default Route to domain/item-url

Is there another solution where I can do it without the dummy article?

  • Moving the blog to /root aka make it /home is not an option, because /home is a modular landing page.

check regex route

I already tried this:

routes:   /blog/(.*): '/$1'

It does not work. The links in the blog overview are still /blog/item-url
If I click them I get

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in /grav/system/src/Grav/Common/Page/Pages.php on line 536 

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 262144 bytes) in /grav/vendor/filp/whoops/src/Whoops/Run.php on line 375

More Info:

The Folderstructure looks like this:

  • /blog/
  • /blog/item1-url
  • /blog/item2-url

In the end the links should look like this:

  • /blog/ (overview)
  • /item1-url (URL to article in folder /blog/item1-url)
  • /item2-url (URL to article in folder /blog/item2-url)