How can I load requested file from another directory (using .htaccess) if that file is not found at the requested URL?
For example:
Request:: mysite.com/samples/image_requested.jpg (does not exist)
Output: mysite.com/samples/missing/image_requested.jpg (without showing the exact url in the browser)
I tried this but it gives me a 500 Internal Error:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/samples/
RewriteCond %{REQUEST_URI} !^/samples/missing/
RewriteRule ^samples/(.+)$ /samples/missing/$1
Here is an example for jpg, png and gif files. It will display always the requested URL (/samples/file.jpg), not the real one (/samples/missing/file.jpg):