What is this about?
I recently stumbled upon the question if Apache can be used for generic shortlink generation?
Why whould I prefer Apache over 3rd party software like yourls?
Of course, there are other options than Apache for that, but let's assume that you are stuck with Apache and can't use any 3rd party software...for whatever reason.
How to do it?
Create a RewriteRule to match all your shortURLs to a target link.
RewriteMap shortlinks txt:/etc/apache2/shortlinks.txt
RewriteRule ^/short(.*) ${shortlinks:$1} [R=permanent,L]
where the shortlinks.txt file should look something like this:
1 /startPage
2 /index.php
3 https://google.com
4 /any/target/URL/you/want?even=with¶meters=nice
This allows me to call example.com/short4 to be rewrited to example.com/any/target/URL/you/want?even=with¶meters=nice which I consider to be pretty neat.
How is this helpful?
Consider you are generating this shortlinks.txt automatically, i.e. in Drupal, maybe even in several versions for different units, like short_crm short_finance etc... One rewrite for each division and you are good to go.
And finally...
This is obviously just a brief look on what you can do, but the possibilities are pretty much endless from here...will update my original post in case of constructive criticism/suggestions or specific questions :)