WEB Outbound URL rewriting

Discussion in 'OT Technology' started by LowClass, Sep 9, 2009.

  1. LowClass

    LowClass New Member

    Joined:
    Sep 5, 2007
    Messages:
    890
    Likes Received:
    0
    Location:
    USA
    Does anyone know how to accomplish this? I was hoping I could do it with mod_rewrite or something but i have no idea what I'm doing.

    Basically i need to append a string before a URL and encode the URL. There is no way to change all the links on the site so i was hoping i could get something that rewrote them when clicked, that way i can do it on any site really.

    Anyone have any idea?
     
  2. bomber

    bomber Go Balls Deep

    Joined:
    Jul 14, 2006
    Messages:
    108
    Likes Received:
    0
    Location:
    Philadelphia
    Use something like jquery, add a click function to all the href tags in your content div that modifies the address when you click it.

    Something like $("#content a").click(function(){$(this).attr('href','new link');});
     
  3. hsmith

    hsmith OT Supporter

    Joined:
    Feb 24, 2002
    Messages:
    124,562
    Likes Received:
    650
    Location:
    Your mother.
    well, why?
     
  4. LowClass

    LowClass New Member

    Joined:
    Sep 5, 2007
    Messages:
    890
    Likes Received:
    0
    Location:
    USA
    I will have to look into this, i am not a programmer but if its something i can look up and trial and error ill do it

    just a wordpress site, with a bunch of outbound links on it

    site is huge and all links are in place, need to redirect them through another service now, so i need to append the URLs to a forwarder and they have to be encoded
     
  5. Insert Tokens

    Insert Tokens Making Cancer My Bitch OT Supporter

    Joined:
    Jan 12, 2006
    Messages:
    8,329
    Likes Received:
    75
    Location:
    Tasmania
    jQuery is the way to go, but if you only want to do it to some links, and not others, you still might need to add a class like <a href="" class="external"> or something..

    If it's EVERY link inside the postbody, that's easy since the post has classes on it already.
     

Share This Page