httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Candler <>
Subject [users@httpd] mod_rewrite setting handler
Date Thu, 28 Jul 2005 11:42:32 GMT
Question: is it possible to set the MIME-type and the handler separately in

(1) If I do

RewriteRule \.shtml?$  -  [T=server-parsed,L]

then the page is parsed, but the wrong MIME type is sent to the client
("server-parsed" instead of "text/html")

(2) If I do

AddHandler server-parsed .shtml .shtm
RewriteRule \.shtml?$  -  [T=text/html,L]

then I get the right MIME type, but no server parsing.

(3) I can make it work like this:

AddType text/html .shtml .shtm
AddHandler server-parsed .shtml .shtm
RewriteRule \.shtml?$  -  [L]

but that's a bit limited flexibility-wise (i.e. it only applies for files
ending .shtm or .shtml). Is there a better way of doing this?

Obviously, these rewrites are cut-down examples. If *all* I wanted to do was
match .shtm or .shtml and set the MIME-type and handler, the rewrite
wouldn't be needed in (3).



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