Content–Type for XML/XSL Jun03 '05
.htaccess file
Here’s the contents of my .htaccess file:
RewriteEngine on
RewriteRule !\.(xml|xsl|gif|jpg|css|js|txt)$ /home/username/path_to_index_file.php
AddType php-cgi .html .htm
Notice the xml and xsl rewrite rules (among the others), which tells the rewrite engine to redirect every file except ones with those extensions.
Content–Type header
Here’s my Content–Type header, in my index file:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Every file, beside the ones with extensions from above, gets re–directed to my index file, which contains the Content–Type header from above.
XML treated as HTML
However, it doesn’t seem to be working properly, because XML or XSL files are still being re–directed to my index file, and I don’t want them to be.
My XML or XSL files are being treated as text/html, which inhibits them from being displayed, or rendered properly.
Does anyone know the appropriate Content–Type for an XML or XSL file?
Categories: Apache
, Web Development
, XHTML ![]()
Add Feedback (view all)
Leave feedback
Perfect... thanks Josh. I wonder how much of an effect changing text/html to application/xhtml+xml would have on m ... Read more.
matthom
is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from a suburb of Chicago.
Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.
- The "swagger" of a red–hot team
- Blog system: show neighboring entries
- Your reunion is always happening
Popular Pages
- Fast rounded corners in Photoshop (5671 recent visits)
- PHP – passing variables across pages (2080 recent visits)
- JavaScript set selected on load (1735 recent visits)
- Removing all child nodes from an element (1206 recent visits)
- iPod songs out of order? (1008 recent visits)
- Firefox 3 smart address bar: wildcard search (911 recent visits)
- Britney - Everytime piano tab (869 recent visits)
- MySQL LEFT JOIN syntax (728 recent visits)
- Breathe Me - Sia (661 recent visits)
- Tumblr: how blogging should be (546 recent visits)
Similar Entries
- Table rendering and table–layout (70 recent visits)
- New RSS feed – Bulls game alerts (0 recent visits)
- Implement "nofollow" for hand–coded sites? (0 recent visits)
- WEGO – The Web Ego project (4 recent visits)
- PHP – passing variables across pages (2080 recent visits)
- Office ergonomics – Standing vs. Sitting (48 recent visits)
Stats
3 unique visits since August 2008
application/xhtml+xml - as just recently alluded to on the ... Read more.