I would like to create a friendly url for a specific file from a directory that has a long file path as well as renaming the file. I am not even sure if this is possible.
So far I have tried in htaccess:
RewriteEngine On
Options +FollowSymLinks
RewriteRule eventdays-2012/brochure.pdf(.+)$ sites/default/files/docs/fact_sheet-204499207.pdf
… but this is not working.
I’ve done some searching and see where you can mask an entire directory in the file path but in my case I just want to do one file within the directory, create a directory name and change the file name as well.
Try removing the
(.+)part from your regular expression. It makes it so you need something after thebrochure.pdf. Also add some boundaries: