I've got a site on a single domain (say, iframedomain.com), that is loaded via iframe through another domain (say, parentdomain.com) and I wish to prevent customers from being able to access it directly. How do you make sure that anybody trying to gain access to iframedomain.com get rerouted to parentdomain.com without blocking Search engine optimization to iframedomain.com?

Solved this problem by using this script here: