httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <>
Subject RE: [users@httpd] Whats happening on rewrite
Date Tue, 01 Oct 2002 13:11:32 GMT
I confirm that the scheme works with Netscape but fails with IE. What happens is that IE tries
to start a download process but then it fails for some unknown reason (the error message is
generic and uninformative). I notice that the "filename" which IE wants to use to save the
file is "...t=files&action=download&id=53" - i.e. the tail end of a cgi request.

When I hit your server directly from a command line, I get a "302 Moved Temporarily" redirect
to the resource This
URL returns the PDF file with the mime-type set to application/pdf.

So what seems to be happening is that Netscape works because it obeys the HTTP spec and treats
the mime-type as authoritative. However, IE violates this spec (this is well known) and tries
to make its own judgement about the file based on its name etc. I think your funny redirect
URL is screwing it up - possibly it thinks is another site... Anyway, the fix is
to remove the redirect flag from the rewrite rule so that the PDF content is returned immediately
from the first URL. Then mime-type and file-type will match and even IE will be happy.

>-----Original Message-----
>From: Eric Persson []
>Sent: Dienstag, 1. Oktober 2002 13:38
>Subject: Re: [users@httpd] Whats happening on rewrite
>Boyle Owen wrote:
>> How are you using mod_rewrite? If you use the [R] flag, 
>mod_rewrite sends a 
> >redirect to the client to the new URL. This has the 
>advantage that the 
>URL in
> >the browser location bar is updated - this may be what you want. 
>However, this
> >might screw up IE...
>> If you are not using the [R] flag, then all the rewriting is 
>done on the 
> >server side and the browser should be none the wiser - hence 
> >complain...
>> Post an extract from your rewrite log showing a full 
>transaction and post a 
> >copy of your rewrite rules again (I've lost the original post) and 
>I'll look again.
>Ok, here goes, the url is: 
>If you cannot 
>get the file with IE, then try to create a small html file 
>with this in a href and try then.
>and the resulting logs from one session is:
> - - [01/Oct/2002:08:36:19 +0200] 
>[][rid#82bbf14/initial] (2) init rewrite engine 
>with requested uri /Produktblad/Sika-1 PB.PDF
> - - [01/Oct/2002:08:36:19 +0200] 
>[][rid#82bbf14/initial] (2) rewrite 
>/Produktblad/Sika-1 PB.PDF -> /get_file.php?directory_id=1&file=Sika-1 
> - - [01/Oct/2002:08:36:19 +0200] 
>[][rid#82bbf14/initial] (2) local path result: 
> - - [01/Oct/2002:08:36:19 +0200] 
>[][rid#82bbf14/initial] (2) prefixed with 
>document_root to /opt/www/
> - - [01/Oct/2002:08:36:19 +0200] 
>[][rid#82bbf14/initial] (1) go-ahead with 
>/opt/www/ [OK]
> - - [01/Oct/2002:08:36:19 +0200] 
>[][rid#82bbf14/initial] (2) init rewrite engine 
>with requested uri /
> - - [01/Oct/2002:08:36:19 +0200] 
>[][rid#82bbf14/initial] (1) pass 
>through /
>Thanks for any help..
>   Eric
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:> for more info.
>To unsubscribe, e-mail:
>   "   from the digest:
>For additional commands, e-mail:

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message