Redirect images & mp3s to mirror via htaccess
June 26, 2008 9:13 PM
Subscribe
How do I redirect all my website's images and mp3s to another domain via .htaccess?
I have a domain (foo.com) that ordinarily serves my website and its images and mp3s. I have a mirror (bar.com) that has a mirror/backup of all those images and mp3s.
In the event of a traffic surge on foo.com, I want to make Apache serve all my images and mp3s from bar.com.
All I can find is examples to stop others from hot-linking my files, which isn't what I want.
(Bonus aside question: Am I not turning up examples of this because it's better done in httpd.conf some way?)
posted by frenetic to computers & internet (6 comments total)
2 users marked this as a favorite
RewriteRule ^/([^\.]+(\.jpg|\.png|\.gif|\.jpeg))$ http://bar.com/$1 [L]
posted by sycophant at 9:56 PM on June 26