WPBitLy is a project mainly written in PHP, it's free.
Wordpress BitLy simple shortener
404: Not Found