# How to get out of dot.tk website frames.



## Anigav (Mar 14, 2007)

Hi,

Me and a few friends are building a website hosted on 110mb.com and with a free domain name from dot.tk.

We use frames to have a navigation bar on the left and detail on the right. 

Our phpbb2 forum loads fine but if you go to the game section (using phpbb2 arcade mod) it logs you out. It doesn't do this if you log into http://anigav.110mb.com only when you log into http://www.anigav.tk and so it must be a dot.tk problem.

There is no option to disable URL Hiding in the dot.tk control panel. I have tryed using META forwarding and target="_top" to try and break the page out of the frame but it doesn't work.

Can anyone suggest a way of getting round this or can anyone confirm that if we bought a co.uk the problem would go away?


----------



## gamerman0203 (Oct 28, 2005)

by the sounds of it, you have two seperate sites....? Did you have to install phpbb on both .tk and 110?


----------



## Anigav (Mar 14, 2007)

tk is just for url forwarding. Everything including phpbb is hosted at 110mb.com


----------



## gamerman0203 (Oct 28, 2005)

oh I see. your .tk redirects to your 110 site. Does the actual domain url in the address bar change to your 110 site address after a redirect? PHPBB runs on Sessions and cookies. Cookies can only be read by the domain that set it. So if you go to your 110 address, it can read the cookie, but if you access through your .tk address, it is looking for cookies based on your .tk account. this is merely speculation so I'm not sure if that is actually what's happening.


----------



## Anigav (Mar 14, 2007)

That's exactly what's happening. 

The http://www.anigav.tk name stays in the bar no matter what page i click. That's what I want to try and get rid of.


----------



## gamerman0203 (Oct 28, 2005)

I'm vaguely familiar with .tk domains. Are they just domains or do they offer hosting service with the domain? If they offer hosting or a host page, I have a simple small php script that might be able to do a raw redirect... no guarantees though as I'm not familiar with .tk


----------



## Anigav (Mar 14, 2007)

You can't host anything at dot.tk. It's purely for url forwarding.


----------



## gamerman0203 (Oct 28, 2005)

the php redirect won't work because it needs to be the absolute first thing that the webserver sees and since .tk loads in frames, the web server will see their frameset before the script so it will just generate errors.

I'm sorry to say this, but right off hand, I'm stumped. I'll keep looking into it to see if there is anyway around it.


----------



## Anigav (Mar 14, 2007)

Alright mate, cheers for your help so far anyway.


----------



## gamerman0203 (Oct 28, 2005)

wait try this... might just reload the frame, but worth a shot

in your body tag (<body>) put this: 

onLoad="location.href='http://anigav.110mb.com'"

edit: if that doesn't work, try this:

onLoad="top.location.href='http://anigav.110mb.com'"


----------



## Anigav (Mar 14, 2007)

Nah, just refreshed the frame. It's the right sort of idea I think though.


----------



## Anigav (Mar 14, 2007)

I think I fixed it!

I put 

<script language="JavaScript1.1" type="text/JavaScript"> 
<!-- 
if (parent.frames.length > 0) top.location.replace(document.location); 
--> 
</script>

in the head section of the site and touch wood it's working.


----------



## gamerman0203 (Oct 28, 2005)

sweet! Thanks for posting the fix!


----------



## Anigav (Mar 14, 2007)

No problem. I don't know if a mod wants to add [RESOLVED] to the title in case anyone else wants to find a fix.


----------



## Sneakydottk (Apr 1, 2007)

yup this works too
(insert directly at top of your webpage)
(This removes the 'largest frame' from a given page - so it's perfect for it!)

<script language="Javascript">
<!--
if (top.location != document.location)
top.location = document.location;
//-->
</script>


----------

