View Supr:Short URLs on your own domain
Please note this feature is currently in the Beta stage. It is currently only available for servers running on PHP 5.
Step 1 - Setting up supr.php
Verify that your web server is running PHP 5 with libCurl installed.
Download File:supr.zip.
Unzip and configure supr.php with your account information like the example below. You can find your account information at http://su.pr/setttings/
$domain = "http://yourdomain.com/";
$login = "your_supr_username";
$apikey = "6b976e43234301b4b4be225180ebdd2bd";
Set both search engine friendly redirects (301) and short URLs on your domain option to 1 in supr.php.
$headers->is_301 = "1";
$headers->is_shorturl = "1";
You can verify the file is setup correctly by going to http://yourdomain.com/supr.php?check_install=1. You should see the following in the browser.
{"version":"1","is_301":"1","is_shorturl":"1"}
Upload supr.php to the root folder of your website.
Step 2 - Add the rewrite rules
We need to add a couple rewrite rules so short URLs for your domain can be handled by supr.php script. Please add these lines to your rewrite.conf or .htaccess (usually found in the root folder of your website). The rewrite rules first check to see if the requested web page exists on your website. If it doesn’t exist then it will redirect to the supr.php script if the requested page is in the 4 letter short URL format.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^[a-zA-Z0-9]{4}$ supr.php?supr=$0
RewriteRule ^supr_settings.json$ supr.php?check_install=$0
</IfModule>
You can verify the rewrite rules are running properly by going to http://yourdomain.com/supr_settings.json. You should see the following in the browser.
{"version":"1","is_301":"1","is_shorturl":"1"}
Step 3 - Sync your settings to Su.pr
Simple visit http://su.pr/settings/ and enter your domain to the list of promoted websites. Click Save and your should see the updated settings for your domain. Once the features are enabled in your settings page, you are ready to go! Try and shorten a URL for web page on your website and you should have your very own short URL!
Step 4 - Get more traffic with the Supr bar
To receive more traffic from StumbleUpon, be sure to display the Supr bar when visitors click on a Su.pr short URL on your domain. The bar will only be displayed to visitors that click on a Su.pr link (it will not be displayed to visitors that come to your website from other sources).
Simply add the following link to your header portion of your web page (usually in a header template file):
<script src="http://su.pr/hosted_js" type="text/javascript"></script>
If you encounter any issues with the installation please leave us a comment in the feedback forum.