I want to add a rule to redirect jpg files to a directory beyond the document root. I already use the following which rewrites anything without a file extension.
Options Indexes FollowSymLinks Includes ExecCGI
RewriteEngine On
RewriteBase /
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^[^.]+$ /index.php/$1 [L]
I want to achieve
http://www.mysite.com/i/image_type/12345.jpg
=>
/internal_path/image_type/12345.jpg
EDIT In this case I ended up using a symbolic link. I am not sure if it was the best solution but it served my requirements.