Reputation: 2805
I needed to add a crossdomain.xml file to my website so that an embeddable flash widget can access its rss feed. The widget is throwing an error, and it looks like it's because my crossdomain.xml file isn't being seen as a valid xml file.
In noticed that if you browse to the crossdomain file on my site the browser opens the download dialog: http://imgfave.com/crossdomain.xml
Whereas if you go to the crossdomain file on another site, the browser opens the file: http://newfoundlandartstore.com/crossdomain.xml
Maybe my server isn't including the proper headers for xml file? Is there anyway to have a php crossdomain file and set the headers in PHP?
Upvotes: 0
Views: 968
Reputation: 143124
At the top, put:
<?php
header('Content-Type: text/xml');
?>
To make the webserver run the .xml
as a .php
file, add this to .htaccess
:
RemoveHandler .xml
AddType application/x-httpd-php .xml
However, you can just avoid the PHP and simply write:
AddType text/xml .xml
Upvotes: 2