I'm using apache 2.2 and that serves a website that some of it's content moved to different directories. is there a way to had some kind of a rewrite rule to .htacces file if the requested file (doesn't matter if it's php or jpg or anything else) doesn't exist, to prepend a directory name and to try again ?
for example:
if the request URL is a/b/c.jpg and it doesn't exist,
to try to search for it in /old/a/b/c.jpg.
thanks!
I think you can do it with
-f
(check if file exists). Try something like this (untested):Edit: fixed typo.
I think it is also needed to check directories. And add the last RewriteCond to avoid recursive rewrites.