Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Redirect Code Help
Amezis
post Mar 22 2005, 11:38 AM
Post #1


Privileged Member
*********

Group: Members
Posts: 535
Joined: 14-February 05
From: Oslo, Norway
Member No.: 3,759



Can someone give me the code which redirects you automatically in the whole page instead of only in the frame?
I'm using this code, but it just redirects inside a frame...
CODE
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.something.com">

But now .tk has added a ad to the pages so I don't want to use it anymore, so I want that people entering the site is being redirected to the "real" domain name now...
Go to the top of the page
 
+Quote Post
serverph
post Mar 22 2005, 03:40 PM
Post #2


Ancient Enigma
Group Icon

Group: [MODERATOR]
Posts: 1,771
Joined: 11-July 04
From: under the stars
Member No.: 76



i suppose you want the code to break out of frames? here it is:

CODE

<script language="JavaScript"type="text/javascript">
<!--
function breakout_of_frame()
{
if (top.location !=location){
top.location.href =document.location.href;
}
}
-->
</script>
</head>
<body onload="breakout_of_frame()">


take note that the javascript has to be inside the head tags (so i included the closing tag for the head tag in the code). don't forget also the command within the body tag (included as well in the code to guide you). hope this helps. smile.gif
Go to the top of the page
 
+Quote Post
Amezis
post Mar 26 2005, 03:15 PM
Post #3


Privileged Member
*********

Group: Members
Posts: 535
Joined: 14-February 05
From: Oslo, Norway
Member No.: 3,759



OK, thanks... However, .tk only had the ad on the top for an hour, then they removed it... tongue.gif dunno if it was only a bug... But thanks anyway, i'm running my page in frames, so thanks for the code.
Go to the top of the page
 
+Quote Post
alexia
post May 2 2005, 09:41 PM
Post #4


Super Member
*********

Group: Members
Posts: 310
Joined: 9-February 05
From: Italian
Member No.: 3,677



sorry i posting i find it on internet
this kind of script for u
3 level

1- level
CODE
<html>
<script>
alert("This page has been moved to a new location... click OK to be redirected.");
location = "http://www.i-code.co.uk/index.php";
</script>
</html>


2 - level
CODE
<html>
<script>
if(confirm("This page has been moved to a new location... would you like to be redirected"))
{
 location = "http://www.i-code.co.uk/index.php";
}
else
{
 history.back();
}
</script>
</html>


3- level
CODE
<html>
<script>
location = "http://www.i-code.co.uk/index.php";
</script>
</html>

I find it on internet by searching and posting here for just learing script
i dont write these scripts i find it for help to u ( not copy pasting)
Go to the top of the page
 
+Quote Post
Amezis
post May 5 2005, 07:22 AM
Post #5


Privileged Member
*********

Group: Members
Posts: 535
Joined: 14-February 05
From: Oslo, Norway
Member No.: 3,759



Thanks, these was nice. However, dot.tk added a big ad frame for some hours, and then it was gone, but I needed that code anyway, so thanks! biggrin.gif
Go to the top of the page
 
+Quote Post
Tyssen
post May 9 2005, 10:40 PM
Post #6



***********

Group: Members
Posts: 1,161
Joined: 9-May 05
From: Brisbane, QLD
Member No.: 6,818



You need to keep in mind that some hosts that force ads on you will suspend your account if you use frame-busting/redirection scripts.
Go to the top of the page
 
+Quote Post
Amezis
post May 12 2005, 09:08 AM
Post #7


Privileged Member
*********

Group: Members
Posts: 535
Joined: 14-February 05
From: Oslo, Norway
Member No.: 3,759



Yes, but I didn't use it for that... Thanks alot for the help anyway smile.gif

The code i am using now, is
CODE
<script LANGUAGE="JavaScript">

<!--
if (parent.frames.length > 0)
{
parent.location.href = location.href;
}
-->
</SCRIPT>

I put it in the body tags, and it works good smile.gif
Go to the top of the page
 
+Quote Post
iGuest
post Jun 24 2008, 01:57 PM
Post #8


Trap Double Mocha Member
***************

Group: Members
Posts: 2,360
Joined: 21-September 07
Member No.: 50,369



html redirect code
Redirect Code Help

About Redirect to other web address // html code --

Http://html-lesson.Blogspot.Com/2008/06/redirect-to-web-addres.Html

-reply by sezer
Go to the top of the page
 
+Quote Post
kevin08
post Jul 16 2008, 09:33 AM
Post #9


Newbie
*

Group: Members
Posts: 1
Joined: 16-July 08
Member No.: 65,070



QUOTE(FeedBacker @ Jun 24 2008, 01:57 PM) *
html redirect code

Redirect Code Help
About Redirect to other web address // html code --

Http://html-lesson.Blogspot.Com/2008/06/re...web-addres.Html

-reply by sezer


Hi FeedBacker,

This page is not opening.

Well, I have a blog and I want to redirect it to my own domain.

Are the above scripts useful to redirect a blog to my own domain? or Is there any other method to redirect a blog to my own domain?

I will appreciate your reply. Thanks...
Go to the top of the page