Description | News
| Contact | Downloads
UrlShortcut is a simple PHP script that let's you maintain a database of "shortcut" URLs.
This allows you to publish URLs to friends that are not extra long, with the purpose of either having easier to type URLs or simply to place URLs in email and avoid the URL being split on several lines. You can also use it as a repository of URLs to consult later or as a reminder of URLs to add to your favorite blog.
What is it?
UrlShortcut is a simple PHP script that let's
you maintain a database of "shortcut" urls.
When a browser visits one of these short URLs, the PHP script will redirect the browser to the original URL immediately.
URL redirections can generally be setup directly in your web server's configuration (IIS, Apache, etc.). Unfortunately, this is generally a manual process that is hard to automatize and also requires administrator access to the web server computer and/or the web server account. On the other hand, UrlShortcut can be installed easily on any web server that has PHP support, such as home page typically provided by ISPs.
To use UrlShortcut, you need:
By default, the script uses the "db4" handler. This can be changed as described later.
Notes: this manual described steps for installation on a typical Linux box. Configuration on other systems should be similar. Please refer to your system maintainer or your operating system vendor for details.
To install, simply untar the archive under your
rename the directory to what you want to see in the final URL. For example:
tar xvzf UrlShortcut-1.0.tgz
mv UrlShortcut-1.0 url
This will make UrlShortcut available as the following URL:
The archive is composed of the following files:
||Core functions and preferences.|
||Redirects to a pre-created URL.|
||Creates a new shortcut for an URL.|
||Lists all known shortcuts and their target URL.|
||An example of
||Directory where the database file will be created and accessed.
Your web server must have write access to it.
Configuration is achieved by editing
common.php and modifying
the following defines at the top of the file:
The following discussion assumes UrlShortcut has been installed as described above and the service is available at the following URL:
1- Creating Shortcuts
To use UrlShortcut, you must first create a shortcut. You can do this by accessing
create.php script and providing the target URL directly on
the query string, like this:
The URL must begin with "
http://" to be accepted.
You will really enjoy and take full advantage of the simplicity of creating shortcuts once you take the necessary step to configure your web browser.
Once a shortcut has been created, a page will display the result shortcut, as this:
The following shortcut:
has been created and registered for the following URL:
Alfray's UrlShortcut v1.0
The first link is what you want to use, copy/paste in emails, etc.
Note that UrlShortcut does not duplicate keys. If you try to create a new shortcut later with the same target URL, you will receive the previous shortcut URL. That means it is safe to call the creation script as many times as you want with the same target URL.
In the shortcut URL generated above, "1" is what makes the shortcut URL unique. This identifier is created by incrementally increasing a counter. The first value is 1 (the value 0 is never used). The counter value is encoded in base 34 using digits and lower-cap letters except letters "o" and "l" (L) which can be easily confused with 0 (zero) and 1 (one). If you need to memorize or write down the shortcut URL, the identifier is all you need.
2- Listing Shortcuts
Once you have created several shortcut URLs, you may not remember where each shortcut points to. The list page will show you that. It is available via a link at the bottom of the create page. To view the list, you simply need to browse this URL:
The result will look like that:
Alfray's UrlShortcut v1.0
3- Using Shortcuts
To use a shortcut, simply enter the shortcut URL in any browser. The script will order the browser to redirect to the target URL, if such a shortcut exists in its database. If not, the user will be presented with an informative message.
If the target URL is no longer valid, UrlShortcut still tries to redirect the browser to the specified URL. Depending on its configuration, the browser will display an error message indicating the page cannot be found.
UrlShortcut has the following limitations:
create.phpscript, unless you are providing a public service. The accompanying
template.htaccessshows how to limit access to these files by IP address.
index.phpscript, anybody can use the service with either a legitimate shortcut URL or a crafted one. Since the redirector has no previous knowledge of who is allowed to use it, by default it allows anybody to do so and cannot, by design, distinguish between valid uses and abuses.
UrlShortcut is distributed under the terms of the General Public License (a.k.a. GPL).
I am not a lawyer and I find licenses generally obscure to read, so what it all means is:
|March 21, 2004||
Version 1.0 completed and ready to download.
Version 1.0 is the most recent stable & only revision.
|Development (a.k.a. unstable)|
- - -
UrlShortcut is developed and maintained by