views:

32

answers:

1

Hi, I'm looking to create an iframe on my site that contains amazon.com, and I'd like to control it (see what product the user is at). I realize I can't do this because of browser security policy issues, and the only real workaround is to feed the entire page through my server. So I load the page and I change all the href values from something like

grocery-breakfast-foods-snacks-organic/b/ref=sa_menu_gro7?ie=UTF8&node=16310101&pf_rd_p=328655101&pf_rd_s=left-nav-1&pf_rd_t=101&pf_rd_i=507846&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=1S4N4RYF949Z2NS263QP

(the links on the site are relative) to 'me.com/work.php?link='.urlencode(theirlink). The problem is the amount of time this takes - plus PHP runs frequently out of memory doing this.

Could I use mod_rewrite to rewrite all domains from:

http://www.me.com/grocery-breakfast-foods-snacks-organic/b/ref=sa_menu_gro7?ie=UTF8&node=16310101&pf_rd_p=328655101&pf_rd_s=left-nav-1&pf_rd_t=101&pf_rd_i=507846&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=1S4N4RYF949Z2NS263QP

to:

http://www.me.com/work.php?url=urlencode(thatlink)

And if not, are there any better options rather then going through every <a> tag?

Thanks!