Forum Moderators: phranque
I plan to use a lot of lines like:
RewriteRule dummy_link1 affiliate_link_1 [R=301,L]
RewriteRule dummy_link2 affiliate_link_2 [R=301,L]
.........................................
.........................................
The only side that is going to be affected is a site visitor. Some visitors (minority) simply can not stand the fact that somebody is going to make comission out of their purchase. Sometimes they copy-n-paste the link into the browser address bar cutting the affiliate id. I despise them and don't mind misleading them by cloaking. I think the right thing is that I get my comission whenever I deserve it.
The ethics issue probably deserves a separate thread, but since it has been raised here I'd like to know the forum members' opinion: do you think affiliate link cloaking is dishonest?
A truly blind-redirect is usually frowned on, because users *should* be able to see where they are going and decide if they want to open the site or not. In this case I would say you are in a grey area:
1. People obviously want the product, so they will need to visit the site, if you tell them the URL or not.
2. People should know they are leaving your site and visiting a 3rd party site before they go, so they can decide.
Not sure which the right answer is, I would probably tell them they will be redirected to the appropriate site when they click a 'buy' link, but due to abuse, will not see the URL until after they click...
As far as the sample code, it looks like it could use some work... I recommend starting in the library --- links at the top left of the pages.
Hope this helps.
Justin
This way, Apache doesn't have to process all those rules unless they are really needed.
Example:
RewriteRule ^cloakingrule-prefx(.*)$ cloakdir/$1 [L]
Then, put rules in the cloakdir/.htaccess
If you have access to httpd.conf (or apache2.conf), it's better for the performace, as Apache doesn't have to parse Rules and compile REGEX each time.
The effect will depend on the number of rules, the order of the rules, the number of visitors you have accessing the site, and a number of other factors.
For the most part if your rules are well structured and ordered, they will have a negligible effect on server performance.
Justin