An XSLT stylesheet does not have an XML mimetype

An XSLT stylesheet does not have an XML mimetype

I have recently been brushing up on my WordPress knowledge for a blog I have created for a client. While working on the blog I noticed that the error below displayed when trying to view a dynamically generated sitemap (/sitemap.xml) in my Firefox browser:

Error loading stylesheet: An XSLT stylesheet does not have an XML mimetype:

http://DOMAIN_NAME.com/wp-content/plugins/google-sitemap-generator/sitemap.xsl

An XSLT stylesheet does not have an XML mimetype

 

 

The sitemap was created by the superb Google XML Sitemaps plugin for WordPress and after a quick bit of research on Google I came across this article at tutsarena.

It is important to mention that the error only occurs in the Firefox browser and not Internet Explorer (for a change). The error is not WordPress – specific but was actually related to the Apache server the client’s website was hosted on.

To fix the error add the following line of code to the bottom of your .htacces file (found in the root of your site):

AddType text/xsl xsl

This adds the MIME type for XSL, which was missing from the list of MIME types on the client’s server.

If you are still having problems try adding the below line of code as well as the above code into the .htacces file:

AddType application/xml xml

This should sort everything out nicely.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *