Rgd: Javascript redirect top parent page
<p>Edited question</p>

<p>In summary:</p>

<p>I got 2 sites
siteA.com
siteB.com</p>

<p>Iframe belong to siteB.com
But i want allow siteA.com to iframe siteB.com page too. However anything that not siteA or siteB.com will be redirect to siteA.com</p>

<p>using javascript, how do i check, consider to ignore with www or without www(wildcard) and also that my site could be siteA.com/pretty-url</p>

<p>How do i do the check and add in the security with javascript , which any random site not authorize will result in window.top.location.href being redirect to siteA.com</p>

<p>Thanks for all help, new here :)</p>
