...

View Full Version : Splash page redirection loop



Madmagoo
11-23-2012, 08:52 AM
When creating a splash page and using the html redirection code how is it best to avoid ending in an endless redirection loop?

The page I want to redirect to is the main index page of the site that I am filing the splash page in. and when I set the splash page going it just endlesslly loops onto itself.

I have tried renaming the index.html file but it gave no effect. I amnot sure what else to try. I am guessing there is some other code that I need to write in to bypass this problem but I can't think of it for the life of me.


<script type="text/javascript">

window.onload=timeout;
function timeout(){
window.setTimeout("redirect()",15000)}

function redirect(){
window.location="name of http link I want to send to"
return}

</script>

That is the redirect code I am using.
Any help would be appreciated, thanks

sunfighter
11-23-2012, 04:20 PM
<html>
<head>
<script type="text/javascript">
function delayer(){
window.location = "someplace.php"
}
</script>
</head>
<body onLoad="setTimeout('delayer()', 5000)">
<h2>Prepare to be redirected!</h2>
<p>This page is a time delay redirect, please update your bookmarks to our new
location!</p>

</body>
</html>

Redcoder
11-23-2012, 04:33 PM
Try:


<script type="text/javascript">

window.onload=timeout;
function timeout(){
window.setTimeout(redirect,15000)}

function redirect()
{
window.location="name of http link I want to send to";

}

</script>

Redcoder
11-23-2012, 04:35 PM
Although I think that you have used a lot of code where farmuch less code would have sufficed. If you are learning how to use functions, thenuse the above code. But Sunfighter's code is much less than yourapproach.

Madmagoo
11-23-2012, 11:52 PM
I appreciate the options but I am still getting the loop.

I tried various combinations but I just cannot get it to stop looping unless I make the url point to anywhere but the index page.

I have had to use my original code and point my URL to my login page instead of the index but now for some reason it is instantaneously redirecting instead of the 15 second delay although I didn't alter that part of the code.

sunfighter
11-24-2012, 12:12 AM
Must be caused by the page your going to. What is it's name?

Redcoder
11-24-2012, 12:27 AM
Or there may be another piece of conflicting code.

Madmagoo
11-24-2012, 02:56 AM
This is the entire code I am using for my page - it is only a basic page for now before I build a better one later as this is a temporary fix while we rebuild the site.


<html>
<head>
<title>Welcome To site name</title>
<style type="text/CSS">
body {background-color:#9FCFFF;};

</style>
<script type="text/javascript">

window.onload=timeout;
function timeout(){
window.setTimeout(redirect(),15000)}

function redirect(){
window.location="http://www.domainname.com/index.php"

}

</script>

<body onload="timeout()">

</script>

</head>
<body>

<center> <img src="logo01.gif" ></center>
<br>
<br>
<br>
<p><center><h2> Due to ongoing technical difficulties, some users may experience delays or outages with the site name site.</h2></center></p>
<br>
<p><h1><b> <center><font color=#076C9F>SITE NAME IS CURRENTLY BUSINESS AS USUAL!!! </font><b></center></h1></p>
<p><h3><b><center> <font color=#FFFFFF>The sites technical team, (TechTeddy and Snoozz), will be working on the site over the coming days and as a result there may be short periods of downtime. Please bare with us and keep checking back frequently. Currently it is business as usual and we hope to have everything 100% as soon as possible.</font></h3><b></center></p>
<br>
<p> <center>If you have any difficulties or questions, please feel free to contact any of the members of the admin team and they will do their best to help you.</center></p>
<p><center><font color=#DE8621> Ros (Stillme) <a href="mailto:email@hotmail.com">Stillme’s email</a> , Bohica <a href="mailto:email@hotmail.com">Bohica’s email</a> Jo (TechTeddy) <a href="mailto:email@live.com.au">TechTeddy’s email</a> , Snoozz <a href="mailto:email@yahoo.com">Snoozz’s email</a></font></center>
</body>
</html>

When I change the URL to


window.location="http://www.domainname.com/ucp.php?mode=login"

Like I said, I just get the instant redirect but at least it is redirecting.

sunfighter
11-24-2012, 03:28 PM
Madmagoo I just have this gut feeling that the problem is the name of the page your redirecting to. index.php is the file that your directed to when you enter a site, but your calling it from the redirect page. Just try this. Change the name to anything else and see if you are still having the problem.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum