I have the following mod_rewrite
directive in my lighttpd config file:
url.rewrite-once = (
"foo.*$" => "static/foo.pdf",
)
I'd like to hand out URLs like this: http://<server>/foo/r=ca2b912
(or similar), such that I can track the origin of the link in the http access log.
When I enter http://<server>/foo/r=131ab42
, however, the "save-as" file dialog is shown and is proposing to name the file r=131ab42
(at least when using firefox). I'd like to have it propose foo.pdf
as file name to save. This should work independent of the tool accessing the URL (ie. wget, IE, etc should all save the file as foo.pdf
).
How can I achieve that? I've noticed that firefox corrects the file name when reloading the URL.
Please note: this is the first time I want to use a rewrite rule. I have tried to find the answer myself, but have not succeeded.