Web development Birmingham

A simple multi-url PHP url shortener script

Here is a simple PHP script for creating your own URL shortening website. It supports multiple domains meaning you could point mydomain1.com and mydomain2.com at the same hosted location and define different URI's to redirect to for each domain.

Download the php files (2.43KB, .zip file)



  1. Ensure the domain name points at the hosting correctly.

  2. Add this index file and the .htaccess file into the root directory for the URL you want to shorten from.

  3. Import the shortens.sql file using phpMyAdmin or similar

  4. Add a line to the database table created for each shortened URL. e.g:
    s_name: test, s_note: some redirect, s_base_from_url: myurl.com, s+base_from_url: /some/text, s_to_url http://www.scorchsoft.com



This script has been created by us and is completely open source and free to use under the MIT open-source licence.

Did you find this article useful? Sharing is a great way to show support, and ensures that we can continue to create more quality articles:

Get a free quote