SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2013
    Location
    midwestern USA
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there a PHP script for automatically converting outbound links to short links?

    example - you put down a link somewhere in your HTML or blog post. the script then converts it to yoursite.com/jk9d9s , automatically, so that you don't have to go through some kind of dashboard every time you want to create a link that redirects.

    I know its possible to use .htaccess to redirect links... so maybe if the PHP can access .htaccess and insert a redirect for every link it detects in the HTML? It would need to come up with a string of characters each time, and make sure that no set of random characters has already been used.

    Twitter is one example of a website that already does this. Any URL on that site submitted by a user is converted to t.co/ (and what its redirected to shows up as the text for the link).

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2012
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •