Forum Moderators: phranque

Message Too Old, No Replies

htaccess for external image hosting?

WordPress upload directory to use Amazon's AWS S3

         

Vastio

7:23 pm on Nov 18, 2007 (gmt 0)

10+ Year Member



I just developed a WordPress plugin that mirrors the upload directory to Amazon's AWS S3. When traffic gets heavy, I can have all the images and static content shown from there.

How can I have the "uploads" directory give all requests to [images.domain.com...] which is setup as a virtual host bucket on AWS? Such that [domain.com...] really shows the image from "http://images.domain.com/image.gif".

I've tried the following .htaccess in the uploads directory, but no go:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$
RewriteRule ^uploads/(.*) [images.domain.com...] [R=301,L]

Vastio

8:25 pm on Nov 18, 2007 (gmt 0)

10+ Year Member



OK... got it.

RewriteRule ^uploads/(.*)$ [images.example.com...] [QSA,L]