Forum Moderators: phranque

Message Too Old, No Replies

Mod_Rewrite for Affiliate Branded Name Site

         

jimpoo

11:49 pm on Jul 21, 2004 (gmt 0)

10+ Year Member



I'm try to figure out how to allow my affiliate sites to access the images which stored in my website's folder. As my site and all of the affiliate sites are hosted in one server.

Suppose that my server folder setting are:
/htdocs/affiliate1.com/html/
/htdocs/affiliate2.com/html/
/htdocs/affiliate3.com/html/
....
/htdocs/myshoppingsite.com/html/images/

Now I store all product image files into the /htdocs/myshoppingsite.com/html/images/ folder.
What I want is that when visitors hit http://www.affiliate1.com/images/abc.jpg, my server can handle it and retrieve the real file abc.jpg from where it stored in, then return a 200 server header code to the browser.
Is it possible?
Anybody can help me out?
Thank you!

jdMorgan

2:32 pm on Jul 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jimpoo,

Given what you've posted, it should be possible to do what you need to do. The problem can be broken down into two parts: First, you need to unabiguously recognize shared-image requests based on the requested URL, and second, you need to rewrite that URL so that it references your shared image directory.

The first part is accompished by using regular-expressions pattern matching on the requested URL, and the second part is accomplished by the URL-rewriting function of RewriteRule. I have posted some references at the end of our charter [webmasterworld.com] that may be useful to you.

Jim