This is to roll my own short URLs (Sometimes those URLs are actually not short π, I just created this and connected a domain I own for the fun and that’s all.) This is how I created and deployed this.
- Create a new repository inside your favorite git hosting service (In my case its GitHub.)
- Inside the repo, create
_redirects
file without any extension. - Inside the file, type your “short-paths” and “long-URLs” like this.
/a-short-path http://some-place-on-the-web
...
- You can put as much as fields as you want and make sure you put a space/s between short path and long path.
- Go to Netlify, create an account and deploy the above created repo connecting your Git hosting service. Need help? Check documentation.
- You will be provided a Netlify-created sub domain and you can change it for whatever you want.
- That’s it. With the power of β¨Netlify’s optimized edge redirects via it’s redirects APIβ¨, Now you have a “Personal URL Shortner”. You can connect your own domain if You have one.
Check my GitHub repo here.
If You have any questions or want to step up this project with automating stuff, check this video.