I migrate a static html site to drupal CMS, most content I just copied the html for now and want to leave it as is and make the relative links to pdf files working. Drupal has all files in this dir: ( I copied the whole tree of FORMER SUB DIRS - nice, want to keep that )
DOCROOT/sites/mydomain.xyz/files/FORMER/SUB/DIRS/filename.pdf
So all relative links in the CMS contents become now:
http://mydomain.xyz/node/FORMER/SUB/DIRS/filename.pdf
I want to check if the file exists and then rewrite the url
RewriteEngine On
RewriteCond /var/www/mydomain.xyz/sites/mydomain.xyz/files/%{REQUEST_URI MINUS "node/"} -f
RewriteRule (.*)$ /sites/mydomain.xyz/files/$1 [R]
How could i achieve that?