Hi friends, Can someone please help me? I use this method to cloak my affiliate links: https://yoast.com/cloak-affiliate-links/ So in our list we just need to put the links like this: name,http://domain.com/?p=2 Code (markup): And we will use the following link: http://www.mydomain.com/out/name Code (markup): My main problem is with the comma... he detects the link after the first comma, but lets imagine that the link is something like: http://www.affiliatedomain.com/track/gTk2NzMwdjQ6sTc,24/ Code (markup): So the problem is that he cant read all url, because the url have an comma too, so the script will read only: http://www.affiliatedomain.com/track/gTk2NzMwdjQ6sTc Code (markup): And will ignore the ,24 part. Is there any fix to this please? A way that the script only read the first comma and ignore the others from urls? Here is the code source: https://gist.github.com/jdevalk/5622742 Help
Hi, i dont know how to fix your problem, but i came across that post before and decided to go with this plugin http://wordpress.org/plugins/redirection/ its the best redirection plugin for wordpress and very easy to use.
I haven't looked at the code, but have you tried enclosing the link in quote marks? So it would be something like name, "Url goes here" Code (markup):
PoPSiCLe, thank you buddy, did the trick and is working perfectly Are you sure that Im not going to have problems with the lines like that? Thanks once again
I doubt it - all it does is enclosing the url as a string, and not parsing it in any way (of course dependant on the code actually parsing the list/urls). As I've still not looked at the code, I can't say for sure that it won't create other problems, but most likely not.
Thank you for your reply buddy. Btw, the source code is here: https://gist.github.com/jdevalk/5622742
Btw, in my website I have some urls with nofollow tag, but I want to remove all nofollow tags and also starting to use this cloak script in all my affiliate links. But I notice this in the official page: https://yoast.com/cloak-affiliate-links/ It says: "Affiliate links are ads, and those should be nofollowed or otherwise prevented from leaking PageRank to the advertiser. Instead of nofollowing each and every link, which is painful and you’re bound to forget at some point, why not make sure search engines can’t follow the link at all?" And If you check the source code: https://gist.github.com/jdevalk/5622742 You will see that line: header( "X-Robots-Tag: noindex, nofollow", true ); Code (markup): So probably this cloak script is not doing what I want right? Making everything dofollow. I can be wrong, but I think that using this script is the same If I'm adding nofollow tag manually in each link affiliate link right? If this is true, maybe is better to remove , nofollow from the code right? Or should I remove noindex too!? Whats the better solution? Thank you buddy!
Depends on what you want to achieve, but if you don't want to use nofollow, just comment out that line completely - noindex you might keep, of course, but that's up to you.
Thank you buddy! In fact is just to mask affiliate urls, but don't want to add nofollow. If I nofollow all my links I'll be telling Google I don't necessarily trust any of the sites I link to and it can hurt me. Just need the link juice flow as naturally as possible. What do you think? Whats the best solution for me? Btw, what does the noindex do? So: From: if ( $url ) { header( "X-Robots-Tag: noindex, nofollow", true ); header( "Location: " . $url, 302 ); die; } else { PHP: To: if ( $url ) { header( "X-Robots-Tag: noindex", true ); header( "Location: " . $url, 302 ); die; } else { PHP: ?
noindex tells a search engine / bot to not index the page - so it depends if you want the actual page this scripts is being used to be indexed or not.
Thanks once again! Understood! Is the code modification above correct? And btw, using the original code with the nofollow mention, is the same if I was using a link like below right? <a rel="nofollow" href="http://www.domain.com">title</a> Code (markup): Or am I understand this wrong!?