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 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
- Social networking: say it; don't spray it
Similar Entries
- Table rendering and table–layout (365 recent visits)
- New RSS feed – Bulls game alerts (3 recent visits)
- Implement "nofollow" for hand–coded sites? (3 recent visits)
- WEGO – The Web Ego project (10 recent visits)
- PHP – passing variables across pages (11893 recent visits)
- Office ergonomics – Standing vs. Sitting (336 recent visits)
Stats
51 unique visits since August 2008
Recent Referrers (click)
- content type XSL
- content-type xsl
- Content-Type XML
- content type xls
- XSL content-type
- xml content-type xsl
- content-type xml xsl
- xsl contenttype
- content
- content type xls
- xml content-type
- contenttype for xls
- .htaccess + xsl
- header("Content-Type: xml
- header("Content-Type: xml
- redirect "every file except"
- Content-type for xls
- xsl content-type
- content type xml
- content type xml
application/xhtml+xml - as just recently alluded to on the ... Read more.