# SWF redirect to different sub domain. Crossdomain policy?

**URL:** <https://forum.kirupa.com/t/swf-redirect-to-different-sub-domain-crossdomain-policy/318920>\
**Category:** flash\
**Created:** [February 3, 2011, 3:05pm UTC](https://forum.kirupa.com/t/swf-redirect-to-different-sub-domain-crossdomain-policy/318920 "2011-02-03T15:05:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulInPA](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@PaulInPA](https://forum.kirupa.com/u/PaulInPA)\
**Post date:** [February 3, 2011, 3:05pm UTC](https://forum.kirupa.com/t/swf-redirect-to-different-sub-domain-crossdomain-policy/318920/1 "2011-02-03T15:05:46Z")

</div>

Hi,

I have a SWF file that is served from a sub domain “[sub1.mydomain.com/folder/myswf.swf](http://sub1.mydomain.com/folder/myswf.swf)” into a web page that is on another sub domain “[sub2.mydomain.com/pages/page1.htm](http://sub2.mydomain.com/pages/page1.htm)”. When the user clicks on the SWF I am redirecting to a new web page “[sub2.mydomain.com/pages/page2.htm](http://sub2.mydomain.com/pages/page2.htm)”. If I serve the SWF from sub domain “sub2” everything works fine, but I am unable to get the redirect to work when I serve the SWF from “sub1”. I believe this can be resolved via the crossdomain.xml policy file:

* * *

\<?xml version=“1.0”?\>  
\<!DOCTYPE cross-domain-policy SYSTEM “[http://www.adobe.com/xml/dtds/cross-domain-policy.dtd](http://www.adobe.com/xml/dtds/cross-domain-policy.dtd)”\>  
\<cross-domain-policy\>  
\<allow-access-from domain="\*.mydomain.com" /\>  
\</cross-domain-policy\>

* * *

This file is located in the site root. I’ve also added these lines of code to my SWF file:

* * *

Security.allowDomain("\*.mydomain.com");  
Security.loadPolicyFile(“[http://www.mydomain.com/crossdomain.xml](http://www.mydomain.com/crossdomain.xml)”);

* * *

But I am still unable to redirect from the SWF using these policy file and script changes. Can anyone provide some insight as to what I am doing wrong?

Many thanks,  
Paul
