Fade-In Slideshow Script
Text Ad Script
Lead Follow-Up Database Script
Address Book Script
AdFreely -Ad Board Script-
URL Shortening Script
Ajax Poll Script
Contact Us Script
Life Insurance Quotes Request Form Script
Real Estate Contact Form Script
Protect HTML Script

Installation Guide

This page will explain how to install URL Shortening Script v1.01

Step 1 Unzipping the downloaded file
After you download the script, unzip it. You will find a folder named web. You will use this folder in later steps.

Step 2 Setting up database configurations
Open web/config/config.db.inc.php in a text editor and find the following code :

define( 'DB_HOSTNAME', 'Your Hostname Here' );
define( 'DB_DATABASE', 'Your Database Name Here' );
define( 'DB_USERNAME', 'Your Username Here' );
define( 'DB_PASSWORD', 'Your Password Here' );
Please replace the highlighted text with your Hostname, Database, Username, and Password.

About Hostname, Database, Username, and Password.
If you have installed any scripts that use MySQL, it may be ultra-easy for you to figure out what those values are. If this is the first time, however, you may be scratching your head or pulling your hair out ( or maybe both? )

Don't feel bad. This step is truely a pitfall that we have all fallen into at least once.

First, slow down, relax, and take your time. All other steps are easy and this is the only step where you need to think a little longer...

Here is a page where I explained each of them in more details. The page will help you figure out what Hostname, Database, Username, and Password are. Check it out!

Save web/config/config.db.inc.php.

Step 3 Specifying the domain name of the short URL
To specifiy the domain name of short URL, open web/config/config.url.inc.php and find the following lines:

//-- The root URL of short URLs
define( 'URL_PREFIX', 'http://mydomain.com/web/redirect/@' );
In this configuration, http://mydomain.com/web/redirect/@ will be the beginning part of short URLs. ( You may want to remove web/redirect/ so that a short URL becomes just http://mydomain.com/@. Removing web/redirect/ will be discussed at the end of this installation guide. ) For now, just replace mydomain.com with your domain name like shown below :
//-- The root URL of short URLs
define( 'URL_PREFIX', 'http://yourdomain.com/web/redirect/@' );

Step 4 Uploading script to your website
Upload the web folder to your web site. You can rename the web folder name to any name you want. In this guide, we assume you didn't change the folder name.

Step 5 Running the installation script
Open web/install/index.php in your browser and click Setup button. After finishing the installation script, remove web/install folder to avoid a security risk.

Step 6 Creating a short name
Open web/url/index.php in your browser. This is the guest page that visitors can create short URLs. Try it!

Step 7 Logging in to the admin panel
Open web/staff/index.php in your browser. This is the admin panel where you can search, add, edit, and delete the urls. Enter admin and password for the username and password, respectively.

Step 8 Changing the beginning part of short URLs
If you followed the installation process described above, the beginning part of short URLs should be http://mydomain.com/web/redirect/@. You may want to remove web/redirect/ so short URLs become much shorter. ( e.g. http://mydomain.com/@ ) To do so, open web/config/config.url.inc.php in a text editor and find the following lines :

//-- The root URL of short URLs
define( 'URL_PREFIX', 'http://mydomain.com/web/redirect/@' );
Remove /web/redirect like shown below :
//-- The root URL of short URLs
define( 'URL_PREFIX', 'http://mydomain.com/@' );
Also you need to move the following two files to the root directory of your web site :
  • web/redirect/redirect.php
  • web/redirect/.htaccess
Each of them will be explained in the next paragraphs

Step 9 Moving redirect.php to the root directory
Before you move web/redirect/redirect.php, open the file in a text editor and find the following line at the top of the file :
require( dirname(__FILE__) . '/common.inc.php' );
Currently, the path shown above is pointing to common.inc.php in the same folder. If you move the file to the root directory of your web site, the reference will be broken. To fix it, replace '/common.inc.php' with '/web/redirect/common.inc.php'.
require( dirname(__FILE__) . '/web/redirect/common.inc.php' );
Save redirect.php and move it to the root directory of your web site.

Step 10 Moving .htaccess to the root directory
If you don't have any .htaccess in the root directory of your web site. You can simply move web/redirect/.htaccess to the root directory. If .htaccess already exists in the root directory, you need to merge the two .htaccess. To do so, open web/redirect/.htaccess in a text editor and select all text in the file and copy and paste it to the beginning of .htaccess in the root directory of your site.

That's it! Have a fun!