Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 6981 invoked by uid 500); 8 Apr 2003 21:33:47 -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: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 6966 invoked from network); 8 Apr 2003 21:33:47 -0000 Received: from psycho.elho.net (62.8.228.162) by daedalus.apache.org with SMTP; 8 Apr 2003 21:33:47 -0000 Received: from elho by psycho.elho.net with local (Exim 3.36 #1 (Debian)) id 1930j3-0005F8-00 for ; Tue, 08 Apr 2003 23:33:53 +0200 Date: Tue, 8 Apr 2003 23:33:53 +0200 From: Elmar Hoffmann To: users@httpd.apache.org Message-ID: <20030408213320.GC24696@psycho.elho.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.3i X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: [users@httpd] Apache 2.0.45 mod_rewrite MIME-type rewriting Hi, On Apache 1.3.27 I successfully use the following to set the MIME-type of XHTML files to text/html instead of the default application/xhtml+xml for Browsers that can't handle the latter: RewriteCond %{REQUEST_FILENAME} "\.xhtml$" [NC] RewriteCond %{HTTP_ACCEPT} "!application/xhtml\+xml" [OR] RewriteCond %{HTTP_ACCEPT} "application/xhtml\+xml\s*;\s*q=0([^.]|$)" RewriteRule .* - [PT,T=text/html] On Apache 2.0.44 and 2.0.45 (Debian GNU/Linux packages) this however does not work, ie. the XHTML files are always delivered with a Content-Type of application/xhtml+xml. I get the folowing rewrite log when simply fetching /index.xhtml with wget: ::1 - - [08/Apr/2003:23:00:46 +0200] [wren.elho.net/sid#811a9d8][rid#846cdd8/initial] (4) RewriteCond: input='/index.xhtml' pattern='\.xhtml$' => matched ::1 - - [08/Apr/2003:23:00:46 +0200] [wren.elho.net/sid#811a9d8][rid#846cdd8/initial] (4) RewriteCond: input='*/*' pattern='!application/xhtml\+xml' => matched ::1 - - [08/Apr/2003:23:00:46 +0200] [wren.elho.net/sid#811a9d8][rid#846cdd8/initial] (2) remember /index.xhtml to have MIME-type 'text/html' ::1 - - [08/Apr/2003:23:00:46 +0200] [wren.elho.net/sid#811a9d8][rid#846cdd8/initial] (1) pass through /index.xhtml This shows that the conditions work and the RewriteRule gets applied, but Apache either seems to "forget" to actually set the MIME-type to text/html or something (some filter?) happening after mod_rewrite set it, sets it back again. As for possibly interfering filters, disabling mod_deflate and mod_headers didn't change anything. elmar -- .'"`. /"\ | :' : Elmar Hoffmann ASCII Ribbon Campaign \ / `. `' PGP key available via pgp.net against HTML email X `- & vCards / \ --------------------------------------------------------------------- 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