Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 20349 invoked from network); 11 Jun 2007 21:46:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Jun 2007 21:46:10 -0000 Received: (qmail 1201 invoked by uid 500); 11 Jun 2007 21:45:56 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 1188 invoked by uid 500); 11 Jun 2007 21:45:56 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 1173 invoked by uid 99); 11 Jun 2007 21:45:56 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jun 2007 14:45:56 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [206.190.38.42] (HELO web50201.mail.re2.yahoo.com) (206.190.38.42) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 11 Jun 2007 14:45:51 -0700 Received: (qmail 74542 invoked by uid 60001); 11 Jun 2007 19:32:00 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=a/o0OyfULoRB4IbsojPYaMa/mfJadhdOh5ulpZJDXE3QRSdYRvT01MuwiTC0RDKZeZDgwu1yRdm99fYu4tGKqnHE8q1QrpAYsabfEIp+Otyo08Jr8ghRFB979dYODzSGvHCoKa6DBPXPMjWCr4DZrvkQgcNiSDuuuE4HS+O457Y=; X-YMail-OSG: ah3ydNcVM1m_X4ZlGujESzoLhRGkScBKvTcdePXVQHpKC2PtzUFq2vu6f9BkWKNGsv8c0Vugpg-- Received: from [192.94.73.2] by web50201.mail.re2.yahoo.com via HTTP; Mon, 11 Jun 2007 12:32:00 PDT Date: Mon, 11 Jun 2007 12:32:00 -0700 (PDT) From: Paul Simon To: users@httpd.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <600595.74471.qm@web50201.mail.re2.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Header set Content-type > > > > Is it impossible to set the Content-Type? Any suggestions? > > > > > > It is impossible to set Content-Type using mod_headers. All the > > > standard HTTP protocol headers are controlled by the apache core and > > > can't be overriden with mod_headers. > > > > > > But you can set Content-Type using any of the standard apache > > > content-type-controlling directives. In your case, you can simply use > > > the T= flag to mod_rewrite, which is much more direct anyway. > > > > > > > I set the T= flag. In the rewrite log I see the flag doing it's thing: > > > > ...rewrite index.php -> /sesp/static/cache/sesp-apprv.csv > > ...remember /sesp/static/cache/sesp-apprv.csv to have MIME-type 'application/ms-excel' > > > > but Content-Type comes back as text/plain instead of application/ms-excel. I'm wondering if > the > > PT flag is causing other modules to override the T= flag. What do you think? > > PT might be the culprit. You can perhaps avoid PT by rewriting to a > complete unix path. But the problem might also be that T= doesn't work > in .htaccess files. I haven't tried it myself, so I couldn't say. > > > > > RewriteRule (index.php|^)$ %{ENV:SESP_LOC}/static/cache/sesp-apprv.csv > > [T=application/ms-excel,PT,L] > > > > At this point, I'm thinking, leave the content type as the default text/plain. Let the > browsers > > handle content-disposition "attachment; filename=sesp-apprv.csv" as they see fit ;-) > > Why don't you just unconditionally set .csv to the right content-type: > AddType application/ms-excel .csv > I added 'AddType application/ms-excel .csv' to the directory block in question. Now .csv is being served as application/ms-excel. I was so wrapped up with rewriterule that I forget about simply setting the type. Thanks! --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See 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