Simple PHP URL shortner (without database)

Posted on under English, Tutorials

Beware! This post is more than 3 years old, it may be outdated or incorrect! Please check elsewhere for accurate information!

It seems that I'm obsessed with making really small and fast PHP scripts, so I made a really simple database-less stand-alone no-config fast URL shortner. It doesn't require mod_rewrite and will work on almost any hosting on the planet.

All you have to do is to create a new file called index.php and put it in a directory and paste the following code in it. It will automatically create a JSON database file and it will also increase the length of the URL if you exceed the maximum number of combinations.


This post was last updated on October 26th, 2013.