|
Just wondering if anyone has any suggestions for detecting affiliate links with PHP. As an example, say that I'm creating a comments section for my website and I want to allow regular links in the comments, but not affiliate links. What would be the best way to go about that?
From an SEO perspective, it would probably be wise to 'no-follow' all user-submitted links anyways, but I would like to try to weed out the affiliates if I can as well.
I suspect that regular expressions could help, but I'm not familiar with all of the different affiliate link formats. Also, I would worry a little about false positives. I could probably also check the url against an array of common affiliate sites like clickbank, etc. However, using that method would require that a large list of affiliate sites be maintained.
I'll probably end up using a combination of the above, but I would love to get some more input if anyone else has ideas as well.
|