Using mod_rewrite to change MIME types

This is a discussion on Using mod_rewrite to change MIME types within the Apache Web Server forums, part of the Web Server and Related Forums category; I have the following code in my httpd.conf in an attempt to direct users away from a certain page ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-24-2003
Michael Newton
 
Posts: n/a
Default Using mod_rewrite to change MIME types

I have the following code in my httpd.conf in an attempt to direct users away
from a certain page if their browser doesn't support XUL. However, all the
HTML files in the directory are sent as application/xhtml+xml which will break
non-Mozilla browsers, so I need to add the [T] flag to the end of the line.

I get a 400 (bad request) returned from the server when using non-XUL browsers.
Is there something obviously wrong here?

RewriteEngine On
RewriteLogLevel 2
RewriteLog logs/rewrite.log
RewriteCond %{HTTP_USER_AGENT} !Gecko [OR]
RewriteCond %{HTTP_USER_AGENT} Safari
RewriteRule ^/mike/chrome/chrome\.xul$ /mike/chrome/nongecko.html [L,T=text/html]

My log file says:

127.0.0.1 - - [24/Jun/2003:13:56:00 --0700]
[localhost/sid#23bb50][rid#46acc8/initial] (2) init rewrite engine with
requested uri /mike/chrome/chrome.xul
127.0.0.1 - - [24/Jun/2003:13:56:00 --0700]
[localhost/sid#23bb50][rid#46acc8/initial] (2) rewrite /mike/chrome/chrome.xul
-> /mike/chrome/nongecko.html
127.0.0.1 - - [24/Jun/2003:13:56:00 --0700]
[localhost/sid#23bb50][rid#46acc8/initial] (2) remember
/mike/chrome/nongecko.html to have MIME-type 'text/html'
127.0.0.1 - - [24/Jun/2003:13:56:00 --0700]
[localhost/sid#23bb50][rid#46acc8/initial] (2) local path result:
/mike/chrome/nongecko.html

Thanks for any help!

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:36 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0