View Full Version : html code redirect to gateway
htd82002
08-29-2006, 01:27 AM
hello! i'm new to html programming. i'm running a very simple website. i had it listed in google, but i now have a problem. it also listed my sub-pages.
basically, what i want is for the user to be redirected to my dot.tk domain instead of being able to directly view my files on my host.
example of what currently happens:
1) i search google, i find http://test.50webs.com/homepage.html
2) i click on it, and it takes me to http://test.50webs.com/homepage.html and shows http://test.50webs.com/homepage.html in the address bar
example of what i want to happen:
1) i search google, i find http://test.50webs.com/homepage.html
2) i click on it, and it should take me to http://test.tk which would show http://test.50webs.com/index.html (where i can click on http://test.50webs.com/homepage.html) but on the address bar it shows http://test.tk
i hope you guys can understand and can help me out.
hope to use simple html codes only, too...
blackpepper
08-29-2006, 01:30 AM
well if im understanding correctly, a good way to do this would be to move your html to the .tk, and then put up a index on your other page with this in it. this will redirect the browser to a specified URL
<META http-equiv="refresh" content="0;
URL=http://yourpage.tk"> this way you avoid using javascript, as it can often be disabled. Did i understand correctly...
htd82002
08-29-2006, 01:38 AM
.tk is a free domain that can only process redirects. i redirected it to a specific index.html so when you go to the .tk domain, it loads that index but says .tk on my address bar.
my question is how to do a redirect so no one can access the subpages (i.e. homepage.html) through google (because my subpages are listed, i don't know why) in order to make sure it will always say .tk on the address bar, not the address of homepage.html.
_Aerospace_Eng_
08-29-2006, 01:39 AM
well if im understanding correctly, a good way to do this would be to move your html to the .tk, and then put up a index on your other page with this in it. this will redirect the browser to a specified URL
<META http-equiv="refresh" content="0;
URL=http://yourpage.tk"> this way you avoid using javascript, as it can often be disabled. Did i understand correctly...
That would work great however now that page will keep redirecting back to the .tk site due to th meta refresh being there. Since the .tk site is just masking your domain you will need to use JS to detect whether or not a page was opened outside of the frameset.
Add this in between the top of your <head></head> tags in your pages.
<script type="text/javascript">
if (top.location == self.location) {
top.location = 'http://test.tk'
}
</script>
htd82002
08-29-2006, 01:39 AM
the .tk loads all my pages through a frame that is why it always says .tk on the address. i just want to make sure that all my pages are accessible only through the frame on my .tk
htd82002
08-29-2006, 01:40 AM
hey i think that's it aero! will it only load my page through the .tk frame?
_Aerospace_Eng_
08-29-2006, 01:41 AM
Yeah it should. If the user goes to the subpage it will redirect them back to the index page using the .tk domain. BTW I can't view .tk sites due to a problem with my isp. RoadRunner uses typically have this probably so remember that. You might actually want to buy some web hosting or at least a domain name.
htd82002
08-29-2006, 01:49 AM
my hosting is fine, it's just the domain that i have trouble procuring, anyway i'll let you know how it works out.
i think safari browser also has that problem, i solved that by eliminating the start-up add and replacing it with a frame ad. maybe it's the same with you? oh well...hope to buy some decent domain name soon, thanks again!
htd82002
08-29-2006, 03:36 AM
hey aero your script works great! thank you!
by the way, just in case you know the answer to it...
i'm building a portal containing search boxes for google, yahoo and msn.
i also have links for their email services.
what i want to do is to create log-in forms for all three for my portal.
i have already extracted the code from yahoo mail, but i can't seem to do it in gmail and msn mail.
in short, i want to have three log-in forms so that the user can easily login with their username and password without having to visit the respective company's email pages.
htd82002
08-30-2006, 10:04 PM
aero there's some problem with the script. now everytime i click on a link, even if i'm on the .tk frame, it reloads back to my .tk homepage.
i'm thinking of taking your advice and getting a decent domain. now how do i do what i wanted to do in the first place: deny access to my subpages unless it is viewed from my domain.
mlinks
08-31-2006, 09:27 AM
OT I know but ...
if you want to stay listed in google DO NOT use javascript redirects or meta refreshes under say 5 seconds.
google will penalize you for cloaking
_Aerospace_Eng_
08-31-2006, 06:55 PM
aero there's some problem with the script. now everytime i click on a link, even if i'm on the .tk frame, it reloads back to my .tk homepage.
i'm thinking of taking your advice and getting a decent domain. now how do i do what i wanted to do in the first place: deny access to my subpages unless it is viewed from my domain.
That should only happen if the links are some how opening out of the frame. Since you haven't posted the original url to your site there isn't much more I can tell you.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.