Snap Builder Public Codes Library
Snap | Generators | Login | Browse | Search | Enter Code | Export Snap Builder Public Codes Library

 

Category: >> .HTACCESS Codes Library >> Force Correct content-type for XHTML Documents


Code Snippet </> Info


Snippet Name: Force Correct content-type for XHTML Documents

Description: Most webservers serve XHTML content as TEXT/HTML which is definitely the right way to handle XHTML documents. In case the server isn't doing that correctly, you can force it on Apache servers with your .htaccess file.

Note:

Author:

Last Modified: 2015-03-26 23:29:16

Language: .htaccess

Highlight Mode: html

Copy Codes: Use Free Notepad ++
Bookmark and Share

Snap HTML Code Editor:
Paste the source code, make changes and instantly see it in live preview.
Snap HTML Code Editor


  About Copying

RewriteEngine On RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0 RewriteCond %{REQUEST_URI} \.html$ RewriteCond %{THE_REQUEST} HTTP/1\.1 RewriteRule .* - "[T=application/xhtml+xml; charset=ISO-8859-1]"


[ Snippet Options ]

 

© 2002 -  Snap Builder Public Codes Library