Keep tinyurl without redirecting towards uid

I have been wondering if there’s a way to use tinyurl for selective site content such as project / sub-projects and disable the redirection to the usual uid but rather keep using tinyurl within the adressbar for every task…

otherwise i’d just randomize the uid to have a similar looking url for each sub project…

No, that would create duplicate content and is currently not supported by Kirby.

What do you want to achieve? Maybe we can find a better solution.

when i create a page as well as children in the panel, i want to use the tinyurl instead of the uid (uri whatever you call it)

for example instead of

/project/project-page-1-whatever

i rather have a short version like:

/project/m64q1z

but tinyurl is just there for redirecting to the real link. However which will then change to how the real url will look like. I want it to be a replacement just for certain pages, i.g. configure in blueprints.

But why do you want that short URL for your projects?

project is just an example.

just in terms of having a non-public not guessable link to specific content
(which link/url is automatically generated)

Instead of making the URL unguessable (which you won’t be able to achieve with tiny URLs anyway), I’d recommend one of the following:

  • Use “random” UIDs
  • Implement some kind of authorization using an URL param (something like /project/project-page-1-whatever/token:g04nc1gb39cn253sjy

that’s what i have said…

actually i have been using it that way before adding a token parameter…

Oh, you are right.

I think a token is the most elegant and robust way to do this. Even it the UID leaks (sitemap, Panel, whatever), the page won’t be accessible wihout the token.

yeah, alright, that’s what i have done before most of the time, so i guess i’ll just default to that then…

I would be greatly interested in a solution for the same problem. I currently have a project

http://dellen.im

where I would prefer to have a short permalink to each news. I see the problem of duplicate content too. The proposed token solution produces too long URIs for my taste. And if I may throw some additional requirements:

  • selective tinyurls (since I don’t want them everywhere)
  • permanent tinyurls (as far as I understand the tinyurl hashes are stored in the cache folder of kirby, which may never get lost or the permanent tinyurls are no longer permanent.

When using tiny URLs like intended (with the redirection), they don’t have the duplicate content issue.

They are permanent as long as you don’t change the original page URI. They are generated every time they are needed and won’t get lost. Each time you get the tiny URL for a specific page URI, you will get the same result.

And concerning the first requirement: Sure, you don’t need to use them on pages where you don’t need them.