redirect URL in iFrame

wayne1

Newbie
Joined
Jul 13, 2009
Messages
4
Reaction score
0
Hi

We have a new domain for our website. The Problem is, that the old domain is not ours and we can't access them.

The old domain directs to a startpage on a server who's also not ours and in this startpage, the owner of this domain has implemented a iFrame where shows the content of our website. Now it looks, as our website is his website, because all contents are shown over his domain!

What we want is, that all users comming over the old domain and this iFrame on his server would redirected to our new domain directly!

Is that possible on any way? Because all redirects in the .htaccess on our server doesn't work :( The users where redirectet, but they see in the URL address bar always the old domain and not our new one.

I think a code where say "everything is comming from domain.old.com, if iFrame or what else, would be forwarded to our domain.new.com and our domain will also showed on the users address bar".

Any idea how we can solve that, because now we have the problem with SEO and double contents :(

Thx
Wayne
 
Last edited:
actually i don't think u have the problem with double content because you're in an iframe and not copy paste

and as for the code

use this javascript code in the <head></head> section of your website

<script>
if(location.href!=top.location.href){
top.location.href=location.href
}
</script>

this basically checks if the current url is the same as the one in the address bar, if it's not then it redirects :)

enjoy his traffic
 
Wow, Lord, you're the best :D

Thank you very much, this works like a charm!!!

Great, thx! :)

Wayne
 
Ey Lord

Only if your interessted, here the code we use now ;)

<script>
var bRmFrame = true;
if (self != top) {
var szRef = document.referrer ? document.referrer : "";
if (szRef.length) { // exceptions
if (0 === szRef.indexOf("http://images.google.")) {
bRmFrame = false;
}
}
if (true === bRmFrame) { top.location.replace(self.location.href); } // overwrite the last history
}
</script>

Regards
Wayne
 
Back
Top