httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
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 http://www.sika.se/index.com?get=files&action=download&id=53. 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 index.com 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 [mailto:eric@persson.tm]
>Sent: Dienstag, 1. Oktober 2002 13:38
>To: users@httpd.apache.org
>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 
>shouldn't
> >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: 
>http://www.sika.se/Produktblad/Sika-1%20PB.PDF
>
>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:
>213.64.190.96 - - [01/Oct/2002:08:36:19 +0200] 
>[www.sika.se/sid#829f404][rid#82bbf14/initial] (2) init rewrite engine 
>with requested uri /Produktblad/Sika-1 PB.PDF
>213.64.190.96 - - [01/Oct/2002:08:36:19 +0200] 
>[www.sika.se/sid#829f404][rid#82bbf14/initial] (2) rewrite 
>/Produktblad/Sika-1 PB.PDF -> /get_file.php?directory_id=1&file=Sika-1 
>PB.PDF
>213.64.190.96 - - [01/Oct/2002:08:36:19 +0200] 
>[www.sika.se/sid#829f404][rid#82bbf14/initial] (2) local path result: 
>/get_file.php
>213.64.190.96 - - [01/Oct/2002:08:36:19 +0200] 
>[www.sika.se/sid#829f404][rid#82bbf14/initial] (2) prefixed with 
>document_root to /opt/www/www.sika.se/pub/site/get_file.php
>213.64.190.96 - - [01/Oct/2002:08:36:19 +0200] 
>[www.sika.se/sid#829f404][rid#82bbf14/initial] (1) go-ahead with 
>/opt/www/www.sika.se/pub/site/get_file.php [OK]
>213.64.190.96 - - [01/Oct/2002:08:36:19 +0200] 
>[www.sika.se/sid#829f404][rid#82bbf14/initial] (2) init rewrite engine 
>with requested uri /index.com
>213.64.190.96 - - [01/Oct/2002:08:36:19 +0200] 
>[www.sika.se/sid#829f404][rid#82bbf14/initial] (1) pass 
>through /index.com
>
>Thanks for any help..
>   Eric
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message