Little bit of code help

Discussion in 'Cloaking and Content Generators' started by llewopsnimajneb, May 13, 2011.

  1. llewopsnimajneb

    llewopsnimajneb Regular Member

    Joined:
    Jan 10, 2011
    Messages:
    242
    Likes Received:
    139
    Occupation:
    SEO, Affiliate marketer, Online marketing lecturer
    Location:
    Backwardstown
    Is it possible to have a dynamic redirect of any outgoing link from any page on a site redirect to an affiliate link based on the root domain of the link?

    eg:
    www (dot) vajj (dot) com/ blah blha baklh whatever
    or
    www (dot) vajj (dot) com/hdhd hd hd hd hd or whatever the extension will be

    all go to www (dot) vajj (dot) com=id/myaffiliatelinkthatmakesmecash

    why?

    many pages on site all with random links that I don't want to go into find and manually update every variation of url to one site..

    Does that make sense?
     
  2. llewopsnimajneb

    llewopsnimajneb Regular Member

    Joined:
    Jan 10, 2011
    Messages:
    242
    Likes Received:
    139
    Occupation:
    SEO, Affiliate marketer, Online marketing lecturer
    Location:
    Backwardstown
    Wow, I just read over that post and I think I was drunk.

    Sorry for the mental anguish that it causes when reading.

    I was trying to ask if it's possible to redirect a link to an affiliate site, if the outgoing link has the domain + any extension that you have an affiliation with.

    so, Jhon puts a link on my directory for bhw and I have an affiliate agreement there.

    jhons link goes to forum.

    I want it to go to shop.

    however jhon also has put a link to bhw/forum/peter-pan

    I want every link with bhw as a domain to go to my affiliate link.

    WITHOUT having to manually edit and redirect it myself.
     
  3. SLSWebber

    SLSWebber Newbie

    Joined:
    Feb 7, 2011
    Messages:
    15
    Likes Received:
    0
    Yea, you can do it. You'd need a database or text file or some way to handle your sites/afiliate links.
    Then you'd use PHP to do a location or a 301 redirect from the original page.
    This isn't the place to learn how to code database driven Websites though.
     
  4. llewopsnimajneb

    llewopsnimajneb Regular Member

    Joined:
    Jan 10, 2011
    Messages:
    242
    Likes Received:
    139
    Occupation:
    SEO, Affiliate marketer, Online marketing lecturer
    Location:
    Backwardstown
    Yeah I know, but I just thought I would ask...

    Thanks for that.
     
  5. nstrum

    nstrum Newbie

    Joined:
    Jan 31, 2011
    Messages:
    13
    Likes Received:
    0
    yes, that makes sense
     
  6. kjr640

    kjr640 Registered Member

    Joined:
    Jan 25, 2010
    Messages:
    98
    Likes Received:
    2
    will this work for all niches ?
     
  7. extremephp

    extremephp BANNED BANNED

    Joined:
    Oct 19, 2010
    Messages:
    1,293
    Likes Received:
    1,274
    Well,from my point of reading you want all your site URLs expect the home page to be redirected to your affiliate link right?

    That can be done using a simple 301 redirect. Or do you want all links from yoursite.com including the homepage to goto your affiliate link? It is even simple, and can be done by a simple htaccess redirect.

    Let me know what I understood is right :)
     
  8. shudogg

    shudogg Regular Member

    Joined:
    Sep 23, 2008
    Messages:
    412
    Likes Received:
    153
    Occupation:
    Internet Marketing
    Location:
    Indiana
    I am not sure exactly what you mean. It can be done possible in the .htaccess file using 301 redirects. It could also be done with a php script that will grab whatever you need out of the URL, then redirect accordingly.