Skip to content

LURL

LURL – Little URL – A program to create shortened urls.

Download:
LURL version 2 to PHP4
LURL version 2 to PHP5

Changelog version 0.2:
– Changes in method to generate the key.
– Minor bugs from PHP4 version.
– Change all the classes of version to PHP5

Dependencies:
– PHP4 or PHP5
– mod_rewrite

Next functionalities (probably):
– Page with list of links letting user to see stats of each link

How to use:
– Create the database with the tables
– Setup Config.php. Example:

$config[“hostname”] = “localhost”;
$config[“username”] = “matheus”;
$config[“password”] = “yourpassord”;
$config[“dbname”] = “lurl_db”;
$config[“domain”] = “http://wordpress.matbra.com”; // Define a configuração da URL inicial (http://wordpress.matbra.com)
$config[“path”] = “lurl”; // caminho/caminho2 (onde está os scripts do LURL)
$config[“my_keys”] = “0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ”;
$config[“num_chars”] = 6;

– Create MOD_REWRITE. Exemple:

<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /

# REDIRECT ACCESS FROM /XXXXXX
# TO /lurl/index.php?u=XXXXXX it is possible to have more chars. (use {7} {8} for it…)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9]{6})$ /lurl/index.php?u=$1 [L]

# IT WAS IN MY MOD REWRITE
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *