Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Hide the folder posts/content are in url

Started by Theodoros 9 years ago · 4 replies · 802 views
9 years ago

Is the a way to have all my posts in a folder,and be able to access them without the folder name in the url?

Example (or look the pic)
site.com/posts/postidname (since postidname is in "posts" folder)
to be
site.com/postidname (but all file still be in posts folder.)

2017-12-07 20_37_41-Pages _ Grav|690x175

On my site http://embrancesblog.com/
if I just rhrow the files in th eroot,the menu is messed up. Any ideas how to fix this?

9 years ago

You can customize routes in configuration > Site and you can use something like this:

TXT
routes: 
     /posts/(.*): '/$1'
9 years ago

Tried it,doesnt work.2017-12-09 10_09_34-Configuration_ Site _ Embrance's Blog - I _3 Embrance! _)|690x122

The home part of the post url,isnt re-written as to not show.

9 years ago

Found anotrher way around it:
In the Configuration anable the option:
Hide home route in URLs

But I dont know still if with other folders it will work.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 56 13 hours ago
Support · by Anna, 3 days ago
2 61 16 hours ago
Support · by Justin Young, 17 hours ago
1 32 17 hours ago
Support · by Duc , 1 week ago
2 66 5 days ago
Support · by Colin Hume, 1 week ago
2 59 5 days ago