I have a XML page www.example.com/page, but my server outputs it as text/plain as it doesn't have any extension.
So I want to add XML Header via .htaccess to all the files which doesn't have extension with a condition that the file exists. As if file doesn't exist, program is executed from database and it decides what header to output, so I don't want to break that part by forcibly changing header.
Add a DefaultType text/xml (or whatever type you're using for your XML) to your .htaccess.
Other command you can put in your .htaccess (but it will force all files to have this content-type):
ForceType text/xml
http://httpd.apache.org/docs/1.3/mod/mod_mime.html#forcetype
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With