URLShorty

URLShorty is an application for shortening and redirecting URLs. For example, take a URL like https://bryan.daneman.org/posts/my-friend-jody—that’s a lot of characters, whether you’re typing it into a browser, pasting it into a social media post or text message, or even using it in a QR code. Instead, what if we had a URL like https://bjd.fyi/jody where jody represents a unique identifier that points to the original URL in our example. That’s a lot fewer characters.

As a URL shortener

As mentioned, URLShorty does two things, the first of which is shortening a longer URL. As part of this, the primary function is to create a unique identifier that maps the shortened URL to the original URL, and stores both pieces of data.

As a URL redirector

In addition to shortening URLs, URLShorty serves as a redirector. When a request is made to URLShorty-shortened URL, URLShorty:

  1. Validates the request
  2. Logs the request
  3. Redirects validated request to the original URL (temporary redirect - 302)

Tech stack

I spent the majority of my career developing on Microsoft technologies, so it should come as no surprise that the technologies used for URLShorty are primarily from Microsoft.

  • .NET 9
  • C#
  • ASP.NET Core MVC
  • SQL Server/Azure SQL (though other relation databases could be used)

More details

Here are more specifics on URLShorty functionality:

  • Web-based admin for authorized users to:
    • Create, read, update, and delete shortened URLs
    • Configure various settings, like:
      • Protected paths (e.g., /admin)
      • Maintain list of disallowed words/phrases for shortened URLs
      • Maintain list of allowed URLs to redirect to
    • View statistics for shortened URLs
  • Secure APIs
    • Create, read, update, and delete shortened URLs

Why

Following the IndieWeb principles of own your data, make what you need, use what you make, and fun, along with the IndieWeb bonus guidance to use a personal URL shortener, why not?

See it in action

You can see URLShorty in action at my personal URL shortener: bjd.fyi.

If you have any questions about this site, please contact us.