Repository Link - Use it yourself!

Url Shortener is an application that Does exactly what it says on the tin. It can use short versions of URLs and direct users elsewhere using HTTP redirects. The application makes use of Python, flask and SQLite. I originally wrote this application because I wanted to use a landing page in my home network and be able to dynamically redirect users to the correct destination. All they have to do is remember URLs like /plex or /files.

break

Other then the examples listed above, there are some other applications this could be used for:

  • Using limited time offer URLs: Upon a short URL creation, it is possible to specify if the URL should expire or not. If the link has expired the user does not get redirected
  • Hard coded URLs in software: Hard coding the short URL in applications makes it a lot easier to manage in the event you then need to redirect the user elsewhere, such as a new help page. If the destination changes, a URL shortener means you update the database once, instead of needing to update every instance of the URL in your software.
  • Potential phishing simulations: With a little modification to the flask application, it would be possible to give each individual user a unique short URL and track if they’d successfully clicked on it.

This hasn’t been the most difficult project overall but I have tried to keep it clean and simple by making use of one single class to manage the database, so the logic can be repurposed in other applications.

The code and documentation can be found at the link at the top of this post!

EOF break