How should short links be supported in Discourse

To me it’s shorter and way cuter this way (with short links) ~

I’m not a dev, but would it be possible to create a link shortener service that would allow use of a shorter domain name ? Like you.me instead of yourdomain.me & with a random text string to redirect on a topic ?

What problem is being solved here? Insufficiently cute links? I mean, I agree with you that

talk.extremely-long-domain-name.online/t/slug/1234

is generally inferior to

talk.web.it/t/slug/1234

… but the solution to that is to prefer a shorter (within reason, and finances of course) domain name?

Plus, you can already “shorten” any Discourse link (to a topic) by doing

https://meta.discourse.org/t/-/15339

versus

https://meta.discourse.org/t/how-should-short-links-be-supported-in-discourse/15339

7 Likes

First, thank you, I didn’t think this could be done this way. But let’s assume my forum is at forum.apertureproject.me, and that I have forum.aper.me (another domain I own) poiting to the main domain (forum.apertureproject.me).

Would replacing a url like this https://forum.apertureproject.me/t/-/1234 by https://forum.aper.me/t/-/1234 work ?

(But well, to me, having it like https://forum.aper.me/1234 would be perfect :slight_smile: I like when it’s as minimal as possible)

Short links in that form are usually best served by a tiny custom web server; I think that redirect can actually be implemented entirely in nginx, so all the customization is in a single config file.

The nginx would redirect https://f.aper.me/1234 to https://forum.apetureproject.me/t/-/1234 .

1 Like

Seems pretty. Could you help me making a script of this kind ?

It’s not a script, it’s an entry in the site configuration within nginx

2 Likes

Yes right. But please, I’d just like to know how to do it since I haven’t found exactly what I was looking for, searching on google

Self-hosted URL shorteners:

Or you can write your own. There are so many because it’s not that tricky to do. The good URL is the hard part. Or you can pay Bitly (and probably others) to host for you.

2 Likes

That’s nice of you to share ! I’ll definitely have a look at it :content:

Thanks

1 Like