Random trick I learned and thought this would be a good place to put it.
If you need to redirect an iframe, but are having security errors and whatnot, use 2 iframes.
So localhost/a.php is an iframe of localhost/b.php. localhost/b.php is an iframe of whatever the hell randomness you want.
Since localhost/a.php is on the same domain as localhost/b.php, you can redirect it wherever you want, and the other iframe changes with it obviously.
If you really want to have fun, you can set localhost/b.php?url=SITEHERE to iframe whatever's in the argument.