I'm trying to convert requests like /download.php?name=one
into /downloads/one.zip
instead.
The following sends the correct file, but the client saves it as download.zip instead of one.zip
RewriteEngine On
RewriteCond %{REQUEST_URI} =/download.php
RewriteCond %{QUERY_STRING} ^name=(.+)$
RewriteRule ^/download.php$ /downloads/%1.zip
How do I get Apache v2.4.35 to send the client the new filename?
It looks like the old PHP would set an http header:
content-disposition: attachment; filename="one.zip"
Is there some way to tell Apache to always send the filename for files from /downloads or something?