我试图建立一个模块来管理文件的下载,所以当有人转到site.com/download/filename.pdf时,它会使用filename参数激活下载模块,如下所示: filename.pdf。如何让Symfony允许文件名作为模块的参数
问题是关于Symfony的重写规则不允许,它会被重写。我需要添加到.htaccess才能防止重写.doc和.pdf文件的这些URL。我已经包含下面的.htaccess文件...
感谢您的帮助!
S
Options +FollowSymLinks +ExecCGI
<IfModule mod_rewrite.c>
RewriteEngine On
# uncomment the following line, if you are having trouble
# getting no_script_name to work
RewriteBase/
# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
# no, so we redirect to our front web controller
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>