Can I ask - why would anyone do this? Several URL shortening services of the past have shuttered and it has left the web littered with links to sites that can never be resolved (linkrot) - this to me just seems like a another surefire way to speedrun future deadlinks in forums etc. Why?
Edit - I have misunderstood the assignment.
This is targeted at self-hosted/personal-domain stuff only, not general internet site URL shortening/redirection.