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

What should I do, if I want the URL looks like'site/post/sjeidjaXaT'

Started by Muut Archive 10 years ago · 7 replies · 355 views
10 years ago

I mean, every page have a random_string(10) as the slug.

Or are there some magic hack to do this?

10 years ago

You could create a plugin that basically hooked into onPageProcessed that basically added a random string as the default route for each page.

Route Header documentation

it would change every time you cleared the cache unless your random string was tied not truly unique, but unique to the page somehow.

10 years ago

I think the random string could be related to the created date of the page, then we are sure it's unique.

That's similar to the URLs in medium.com I think, look:
1

10 years ago

what's the point of the random URL? it can't be very good for SEO or for just readability.

10 years ago

The point is ...
I want the URL is short meanwhile the file path include as much detail as possible.
For example, http://site/p/XyzGWsH --> /siteroot/user/pages/01.post/01.2016/02.02/01.slug-example/post.md

10 years ago

If there are too many files in a folder, like all posts in the '01.post' folder, I'll fell this is a mess...
Hah~~

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1357 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2955 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago