Rewriting path for a specific file using htaccess

后端 未结 1 1090
清歌不尽
清歌不尽 2021-01-19 16:45

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.

相关标签:
1条回答
  • 2021-01-19 17:23

    Try removing the (.+) part from your regular expression. It makes it so you need something after the brochure.pdf. Also add some boundaries:

    RewriteEngine On 
    Options +FollowSymLinks
    RewriteRule ^/?eventdays-2012/brochure.pdf$ /sites/default/files/docs/fact_sheet-204499207.pdf [L]
    
    0 讨论(0)
提交回复
热议问题