Your question is "why would I still receive a 405 even though both url's are form XXXX.com?", but in fact, your URLs are NOT from the same domain.
xxx.yyyy.com
and zzz.yyyy.com
are not the same domain. They may share a significant part of their names, but they are not the same.
This is because it is perfectly possible for the owner of subdomains within a domain to be operated by entirely independent people. Consider uk.com
. The owner of this domain sells the third-level domains within it as a competitor to the standard British country-level domain co.uk
.
The sites at xxx.uk.com
and zzz.uk.com
are completely different sites, and you would not expect the former to be able to load content from the latter without violating the same origin policy rules.
The browser has no knowledge of which domains would do this and which wouldn't, so it plays it safe and assumes that any two subdomains could be operated by different people.
Even yyyy.com
and www.yyyy.com
are not considered the same thing.
I hope that answers your question.
As for what to do about it....
1) Put everything on the same subdomain. The most common reason for splitting a site across multiple subdomains is for performance, but unless you're operating Google or Facebook, it's unlikely to be critical to your performance, and there a probably other things you could do first that would be more helpful. Also, the new SPDY protocol (soon to evolve into HTTP v2) will render the technique obsolete.
2) If you must split it across multiple subdomains, you might want to look into using a crossdomain.xml file, which you can place on each server, to give them explicit permissions to access each other's content.