Little bit of code help

llewopsnimajneb

Regular Member
Joined
Jan 10, 2011
Messages
242
Reaction score
140
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?
 
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.
 
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.
 
Yeah I know, but I just thought I would ask...

Thanks for that.
 
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 :)
 
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.
 
Back
Top