Mobile app version of vmapp.org
Login or Join
Kristi941

: Apache not serving XML file with correct mime type after migration to HTTPS I've just migrated my website from HTTP to HTTPS. And now my sitemap.xml file is no longer served as XML: https://www.pretty-story.com/sitemap_inde

@Kristi941

Posted in: #Apache #Https

I've just migrated my website from HTTP to HTTPS. And now my sitemap.xml file is no longer served as XML:
www.pretty-story.com/sitemap_index.xml
Any idea what could be the cause? Is there anything special to configure in Apache?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kristi941

1 Comments

Sorted by latest first Latest Oldest Best

 

@Mendez628

The MIME-type is not set for the .xml file extension in your Apache configuration, it's coming through as document instead of application/xml. Perhaps you had a suitable configuration for this before but in a section of your Apache configuration that only applies to HTTP and not HTTPS, or did your website actually change server software environment or switch hosting company etc in the process in which case the Apache configuration may simply be different. Either way, to solve this you will need to:

(a) Insert the following lines into your etchttpdconfhttpd.conf file:

<IfModule mime_module>
AddType application/xml .xml
</IfModule>


(b) OR the following line into a .htaccess file in your website folder:

AddType application/xml .xml


You may need to edit existing sections and just add the lines necessary to prevent there being duplicate sections/entries. If the server is managed by another company and you do not control the Apache configuration you will need to follow option (b), though this is the simplest/safest solution anyway, it just means it will only benefit this website and not others on the server.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme