I need to redirect image files to a diferente folder. I tried using:
RewriteCond %{HTTP_HOST} ^example.com$ [NC] RewriteCond %{REQUEST_URI} (.*)\.(png|gif|jpg|jpeg) RewriteRule ^(.*)$ images/$1 [L]
This results in a 500 Internal Server Error, but the following works:
RewriteCond %{HTTP_HOST} ^example.com$ [NC] RewriteCond %{REQUEST_URI} (.*)\.(png|gif|jpg|jpeg) RewriteRule ^(media/1.jpg)$ images/$1 [L]
This also works:
RewriteCond %{HTTP_HOST} ^example.com$ [NC] RewriteCond %{REQUEST_URI} (.*)\.(png|gif|jpg|jpeg) RewriteRule ^(.*)$ images/media/1.jpg [L]
I can't figure out why this is happening, any help?