First, please let me know if this is even possible. Or if there is a different method to use.
At this moment, I'm trying to figure out if there is a way to do mod_rewrite on on images links within pages.
For example
I have a webpage at http://www.example.com/sub-dir/index.php
This page contains images at http://www.example.com/_images/
Ie. http://www.example.com/_images/my-image.jpg
I created a whole new virtual server at /var/www/images/ and a soft link
ln -s /var/www/images /var/www/html/_images
(Any images referenced from /var/www/html/_images will hopefully point to http://images.example.com/
ie. http://www.example.com/_images/my-image.jpg to http://images.example.com/my-image.jpg
In my htaccess file I have so far
RewriteEngine on
#RewriteLog /var/log/httpd/mod_rewrite.log
#RewriteLogLevel 3
RewriteBase "/_images"
#RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^_images/$1 http://images.example.com/$1 [R]
Don't quite have it yet.
Is what I'm trying to do even possible? Am I using the right approach? Or is there a better approach?
Please feel free to let me know. Thanks!