Make URL Shortener Website with Ad and Timer for Free | 2020

0
SHARES
Setup URL Shortener Service/Website with Ad Page and Timer in 2020 using YOURLS for almost Free with a cheap domain and hosting.

Short URLs come in handy for most webmasters. There are multiple costs involved in running a URL Shortener Service. In this article, I will show you how to Setup a URL Shortener Website for free i.e., you won’t have to pay for PHP scripts with this tutorial. I will also show you how you could setup an intermediate Ad Page with Timer on your URL Shortener Service.

Why do you need a URL Shortener in 2020?

Let’s say you have a very popular article about “advantages and disadvantages of organic farming” on your blog. This article’s URL is http://website.com/organic-farming-advantages-disadvantages. Now, consider this for a URL – http://website.com/org-farm which redirects to http://website.com/organic-farming-advantages-disadvantages.

The shorter one can be easily remembered and moreover, since we are just redirecting, you don’t lose the advantage of having your keywords in the URL. The shorter one makes it easier to share your articles offline too.

Moreover, with the intermediate Ad Page, you could also make some extra money.

URL Shorteners are also extremely helpful if you do a lot of affiliate marketing as these URLs can be used to cloak your affiliate links.

Takes just a minute to Subscribe!

Subscribe to our mailing list and be the first to know when we post new content.

Prerequisites

Download

  1. Domain
  2. Hosting
  3. YOURLS Script
  4. YOURLS Interstitial Plugin

Domain – How to choose and where to buy?

To first thing you’d need is a domain. Your decision here needs to be wise. Make sure you get a small domain. Having a domain name such as urlshortenerfree.com contradicts the whole purpose of having a URL shortener. So, here are a few tips to follow:-

  1. Choose a small domain name, maybe, 4-5 letters long. If the URL shortener is for a specific website of yours, try to buy a domain that matches
  2. Choose a small extension. Just choosing a small domain name, wouldn’t work. For eg:- urlsh.in vs urlsh.online. Which one would you choose?

You can get a .xyz domain for just $1 (first year) at Namecheap.

The best part about buying from Namecheap is you get SSL and Whois Privacy Guard free of cost. You may also try other short domains like .in, .io. Domains start at $0.88 at Namecheap.

Get a Domain name at <$1 now!

Hosting

To host our website, we will require a good hosting. While the preferred is VPS hosting, if you plan on starting out small, go for a shared hosting plan. There are multiple providers out there. If you’ve had a good experience with any of them, go for it. Else, you may try Namecheap.They currently are selling hosting plans at a 50% discount.

Get Shared Hosting at 50% off

Get VPS Hosting at 20% off

With the plan, you also get Namecheap VPN free for 30 days.

If you plan on going with Shared Hosting, you may choose the beginners Stellar Plan which offers 20GB Disk space, 3 domains, unlimited bandwidth, etc.

YOURLS Script

We are going to use YOURLS Script for our Link Shortener Service.

Advantages of YOURLS

  1. Free.
  2. Highly customisable.
  3. Lots of plugins.
  4. Analaytics and Stats feature inbuilt.

YOURLS Interstitial Plugin

Using this plugin, we will run our intermediate Ad page with timer similar to what services like AdFly do. Download the plugin here.

Setup URL Shortener Website/Service in 2020

Now, let’s begin the actual process of installation and setup. Follow these steps in the same order as below:-

Install YOURLS

There are multiple ways to install YOURLS depending on the hosting you have chosen.

Install YOURLS with Softaculous

Almost all hosting providers have Softaculous Installer in the CPanel. Contact your host to find out. Namecheap’s CPanel has it. So, on your CPanel, go to Softaculous and install YOURLS. Just follow the directions properly. Make sure to choose a good username and password.

Install YOURLS manually

  1. Go to your website’s CPanel. Using MySQL Database Wizard, create a Database and a corresponding user. Make sure to note down the MySQL Database Name, Username and Password.
  2. Download YOURLS script here. Extract it.
  3. In the folder user, rename config-sample.php to config.php.
  4. Open config.php with your favourite editor and make changes in the following lines:-
    1. define( 'YOURLS_DB_USER', 'your db user name' );– Replace your db user name with MySQL Database’s username.
    2. define( 'YOURLS_DB_PASS', 'your db password' ); – Replace your db password with MySQL Database’s password.
    3. define( 'YOURLS_DB_NAME', 'yourls' ); – Replace yourls with MySQL Database name.
    4. define( 'YOURLS_DB_HOST', 'localhost' ); – Replace localhost with server name. localhost is default for most. Contact host if localhost doesn’t work.
    5. define( 'YOURLS_SITE', 'http://your-own-domain-here.com' ); – Replace http://your-own-domain-here.com with your domain name. Do not add a trailing slash (/) after the domain.
    6. define( 'YOURLS_COOKIEKEY', 'modify this text with something random' ); – Replace modify this text with something random with anything you want. Just make it long.
    7. 'username' => 'password', – Modify username with anything you like and password too. Make sure they aren’t easy to guess.
  5. Once edited, save the file and upload all the contents inside the YOURLS folder containing folders such as admin, css, etc to your server using CPanel’s File Manager or FTP. Remember to upload only the contents of the folder, not the folder itself.
  6. Now, on your web browser, go to http://yourdomain.com/admin and this will install YOURLS.
  7. To check, go to http://yourdomain.com/admin and now it will ask for your username and password. Enter and try to shorten links.

If you just wanted a redirection service without an intermediate Ad Page, then you can stop here. Else, continue.

Setup Ad Page with Timer on YOURLS

  1. Browse to user/plugins on your website server using CPanel’s File Manager of FTP.
  2. Within plugins folder, create a folder named interstitial.
  3. Extract YOURLS Interstitial Plugin.
  4. Upload all the contents of folder yourls-interstitial-plugin-master i.e., css, img, plugin.php and template.html to the interstitial folder we just created.
  5. Go to http://yourdomain.com/admin and click on Manage Plugins on top left.
  6. To the right of Joel’s Interstitial Plugin for YOURLs, under Action, click Activate. That’s it!
  7. Check by going to a Short URL.

Now, you will see default set content and logo appearing. You can change all of that.

Setup Ads and Logo in YOURLS Interstitial Plugin

  1. On your server, browse to user/plugins/interstitial.
  2. To setup ads, open template.html with a text editor and replace %ad% with your Ad code.
  3. To replace logo, browse to img folder within interstitial folder and replace logo.jpg with your logo.

All the changes you want to make to the Ad page like increasing or decreasing the timer period, changing the feel and looks can be made in template.html and the related interstitial.css within css folder.

Conclusion

There’s a lot of scope for customisation when it comes to YOURLS. So, I might come up with more related articles. Till then, keep experimenting with multiple plugins available for it. Hit a roadblock? Comment below!

Share this article with your friends:-

0
SHARES
Category: Website

Like it? Tell us about it.

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