ApacheRewrite

Aus crazylinux.de
Version vom 24. November 2005, 22:36 Uhr von Jonathan (Diskussion | Beiträge)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springen Zur Suche springen

Another solution for getting the browser to use the right filename for saving is to use mod_rewrite to hide the fact that you are using a script at all. Either in the httpd.conf or a .htaccess file, include something like the following:

RewriteEngine On
RewriteRule ^/downloads/(.*) /getFile.php?filename=$1 [NE]


mod_rewrite will translate the url, and the browser (and the user) won't know the difference.