Hacking your own link shortener

TL:DR – You can set redirects on your server so that you can give people a shortened URL that takes them to a resource with a much longer URL. Most of us are familiar with the various link shorteners that have been with us for well over twenty years now. I think tinyurl was the first one I used, but there are many more like ow.ly, bit.ly, goo.gl, t.co etc. Some of them are hard-coded into websites and apps so that any link (URL, uniform resource locator) you post gets shortened to save resources and allow the app to track. To hack your own link shortener, you need your own domain name. That can be your website domain, of course, but you could find a tiny little domain like those above and pay to register that and then use it to do the conversions. I am sure lots of people do that and lots of people have code running on their server or whatever to redirect anyone who has the shortened link to the proper page. Personally, I haven’t bothered with an alternative, so my shortened links are basically of the form sciencebase.com/someword. For example, I have set up the following URL on my domain sciencebase.com/music to redirect to a detailed blog post about my music activities which automatically redirects to the full URL for the page https://www.sciencebase.com/science-blog/sciencebase-to-sciencebass.html which as you can see is far more unwieldy than sciencebase.com/music I use the so-called .htaccess file on my server to do the redirect which simply involves editing...
Source: David Bradley Sciencebase - Songs, Snaps, Science - Category: Science Authors: Tags: Social Media Source Type: blogs
More News: Blogging | Science | Websites