1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Tutorial] How to Make Your Own Mass URL Shortener

Discussion in 'Cloaking and Content Generators' started by tacopalypse, Oct 3, 2010.

  1. tacopalypse

    tacopalypse Executive VIP Jr. VIP Premium Member

    Joined:
    Nov 30, 2009
    Messages:
    980
    Likes Received:
    2,485
    Home Page:
    first, head over to your favorite domain registrar. (godaddy, namecheap, enom, etc)

    type in 2 random numbers and 1 random letter to get a 3-letter domain name. the cheapest 2-letter TLDs are .us and .me at around $8, and 90% of them aren't taken yet.
    (or you can just get the .info you're broke and don't mind the 2 extra letters)
    example: 4m5.us (uber-short!)

    attach it to any ol' hosting. free hosting works just fine, as all we'll be doing is bouncing redirects off of it.

    open up notepad and create this php file:
    index.php
    PHP:
    <?php 

    $a 
    = array( 

    => 'http://www.google.com',  
    => 'http://www.yahoo.com',  
    => 'http://www.ask.com',  
    => 'http://www.meatspin.com',  
    => 'http://www.blackhatworld.com',  

    ); 
      
    header('Location: ' $a[$_SERVER['QUERY_STRING']]);  

    ?>
    put the index.php at the root of your domain, and make sure to delete any index.html or index.htm files that may already be there.
    then you can link your shortened urls like this: (where the number at the end is the index of the url you want to redirect to)
    Code:
    4m5.us?3
    

    enjoy :D
     
    • Thanks Thanks x 15
    Last edited: Oct 3, 2010
  2. comparco

    comparco Regular Member

    Joined:
    Feb 22, 2008
    Messages:
    291
    Likes Received:
    265
    Occupation:
    trying to make a living online
    Location:
    Scotland
    Clever stuff many thanks tacopalypse.
    Could this be then used as a public service like the others with ads on the site?
    or would that "overheat" your hosting account?
     
  3. tacopalypse

    tacopalypse Executive VIP Jr. VIP Premium Member

    Joined:
    Nov 30, 2009
    Messages:
    980
    Likes Received:
    2,485
    Home Page:
    if you wanted to make it public and allow your visitors to input their own links, then you'd have to make an interface for it and probably store all your links into a mysql database or something, which gets a little more complicated than the stuff here.

    on the other hand, you could just have your visitors send you the links manually and then place them into the source code yourself, but that could get tedious :p

    simple redirects like this wouldn't generate hardly any server load unless you were sending like hundreds of thousands of clicks through it or something
     
  4. Grey Area Hat

    Grey Area Hat Registered Member

    Joined:
    Jul 30, 2010
    Messages:
    67
    Likes Received:
    10
    Occupation:
    Marketing
    Location:
    UK
    That looks really useful, but would people click on them given they wouldn't have heard of the url shortern before?
     
  5. tacopalypse

    tacopalypse Executive VIP Jr. VIP Premium Member

    Joined:
    Nov 30, 2009
    Messages:
    980
    Likes Received:
    2,485
    Home Page:
    the link looks sketchy as all hell xD

    but imo, bitly links and any url shortener links look pretty sketchy to begin with.
    the intention that you're hiding the destination url is pretty obvious either way.

    best way to make your links 'friendly looking' is to buy a dedicated domain for it and bounce redirects off of that, but that can get expensive
     
  6. hilary

    hilary Newbie

    Joined:
    Oct 10, 2010
    Messages:
    16
    Likes Received:
    0
    Useful Information ,,, Thanks much
     
  7. Dean820

    Dean820 Newbie

    Joined:
    Mar 9, 2008
    Messages:
    8
    Likes Received:
    0
    Thanks for the info...
     
  8. erdistfroh

    erdistfroh Newbie

    Joined:
    Oct 20, 2010
    Messages:
    15
    Likes Received:
    0
    Thank you so much for the info!
     
  9. LukaB

    LukaB Jr. VIP Jr. VIP Premium Member

    Joined:
    Apr 3, 2010
    Messages:
    3,546
    Likes Received:
    4,247
    Gender:
    Male
    Location:
    Planet Earth
    Really awesome info :) rep given for sure
     
  10. bavahz

    bavahz Registered Member

    Joined:
    Nov 26, 2008
    Messages:
    65
    Likes Received:
    103
    Occupation:
    marketing rep
    Location:
    Milwaukee area
    To save time and find a Bunch of 3 character possible domains I went to AV*XHome and searched for a random number/password generator.

    Found Password Generator pro,installed and
    set it for 3 numbers/letters combinations and for 500 results.
    ran it and posted the results at GoDaddy and found some nice ones to select from.
    Sure beats typing in by hand :)

    JB
     
  11. SuccessPass

    SuccessPass Newbie

    Joined:
    Dec 14, 2008
    Messages:
    43
    Likes Received:
    0
    What do you think of using subdomains for affiliate links? I have been doing that for a while and it seems to be ok.What would happen if you got a ton of traffic to go through a subdomain to a affiliate site?
     
  12. makemoneynotdrama

    makemoneynotdrama Newbie

    Joined:
    Oct 29, 2009
    Messages:
    33
    Likes Received:
    4
    Occupation:
    Internet.
    Location:
    Your Inbox.
    hmmm simple but effective. thanks, will be testing this on my free host tonight
     
  13. Venture

    Venture Regular Member

    Joined:
    Jun 25, 2010
    Messages:
    324
    Likes Received:
    100
    hell yea nice
     
  14. Simmeon

    Simmeon Newbie

    Joined:
    Oct 17, 2010
    Messages:
    15
    Likes Received:
    1
    Home Page:
    Most definitely will use it.
     
  15. MiLiTARYiV

    MiLiTARYiV Senior Member

    Joined:
    Jan 9, 2008
    Messages:
    959
    Likes Received:
    595
    Occupation:
    Webmaster
    Location:
    The Office
    any software that does this yet around?
     
  16. yolkepalke

    yolkepalke Newbie

    Joined:
    Oct 5, 2010
    Messages:
    19
    Likes Received:
    2
    Is there any benefit compared to other link shortening already.
     
  17. needcreative

    needcreative Newbie

    Joined:
    Oct 31, 2009
    Messages:
    14
    Likes Received:
    0
    Nice mate, really nice. I created a URL shortener app the other day using yourls. Really easy even for a newby! Wish I could post the URL but can't!lol
     
  18. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,227
    Occupation:
    Retired
    Location:
    Old Peoples Home
    There is a way of doing this without MySQL if you want something quick and dirty....if I get 10 minutes tonight I will show you how :)
     
  19. llewopsnimajneb

    llewopsnimajneb Regular Member

    Joined:
    Jan 10, 2011
    Messages:
    242
    Likes Received:
    139
    Occupation:
    SEO, Affiliate marketer, Online marketing lecturer
    Location:
    Backwardstown
    Fatboy,

    I have a free short domain if you want to work with me to do a BHW shortner?

    nice and simple.

    my php sucks though
     
  20. Henryy

    Henryy Newbie

    Joined:
    May 13, 2011
    Messages:
    14
    Likes Received:
    0
    i thought this was pretty useful, thanks man.