1

I have a number of subdomains, which are using crossdomain.xml file and I'm looking to a simple way of managing them all - which get semi-regularly updated. One way I've thought is a PHP script, which pushes and overwrites the xml file. The other, which I much prefer is a an apache redirect on a single file.

So, question is how would I, across multiple domains, redirect an xml on dom1.domain.com and dom2.wirewax.com to the same crossdomain.xml file without Flash getting upset about. i.e. not a 302 HTTP redirect, but internal file fetching.

Community
  • 1
  • 1
waxical
  • 3,826
  • 8
  • 45
  • 69

1 Answers1

1

You can write a PHP script that fetches the content from a single location (database or text file) and sends it as-is to Flash. Yes, the script itself needs to be copied on all hosts.

If you have all websites hosted on same webserver, perhaps mod_alias could help:

Alias /crossdomain.xml /path/to/shared/crossdomain.xml

I have not personally tested this. The reference page includes instructions to setup the shared directory so that it can be read by multiple hosts.

Salman A
  • 262,204
  • 82
  • 430
  • 521
  • The file literally needs to be called crossdomain.xml (Flash has this hard coded to request from root URL) so it can't be parsed by PHP without being explicitly .php, no? – waxical Mar 05 '12 at 10:24
  • You can add a simple `RewriteRule ^crossdomain\.xml$ crossDomainGrabberScript.php` in the appropriate .htaccess file. – Salman A Mar 05 '12 at 10:28