Forum Moderators: phranque

Message Too Old, No Replies

Impact of mod_rewrite on server speed

         

arikgub

4:21 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



How many links may I have in mod_rewrite without slowing the server down?

I have hundreds of affiliate links I'd like to cloak using mod_rewrite. Is it OK to have so many mod_rewrite lines in .htaccess?

extras

4:48 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



I wouldn't do that.
Besides, it's not so honest and not even effective, most probably.

But why don't you show an example of what you will be doing?
Without actual code, we can just guess.

arikgub

5:45 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



Sorry, may be I miscomprehend this but what is not honest about affiliate link cloaking? SEs are not misleaded and merchant's site is still credited PR cause I merely gonna give 301 redirect through .htaccess (I guess I misused the term "mod_rewrite").

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?

jd01

6:33 pm on Jan 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So, what you are really doing is sending them through a 'blind-redirect' to get to the affiliate site...

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

extras

7:05 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



To reduce performance issue, you can put them in a separate dirctory,
and put all these "cloaking" rules in that.

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.

jd01

12:26 am on Jan 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sorry, I didn't answer the original question...

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

arikgub

6:55 am on Jan 25, 2006 (gmt 0)

10+ Year Member




extra, I'll use your REGEX tip, thanks

jd01, The text of my links says "Buy from $MerchantSite", so the visitors know they are leaving my site and go to the Merchant site. I hope that takes me out of the gray area :-)

Thanks all