This topic is in the Website Design discussion forum.  (rss)


Alternating homepages?




Topic started on 3-3-2005 @ 01:10 PM by Event Horizon


Does anyone know if its possible to have alternating homepages?



reply to this post:   copyright & usage 


reply posted on 3-3-2005 @ 01:29 PM by dbates


You could probably do a random home page with Javascript.
Use the following code for your "index.html" page.

 
< html >
<head>
<script type="text/_javascript">
<!--
function RandomPage(){
loadPage[0] = "http://www.mydomain.com/index1.htm";
loadPage[1] = "http://www.mydomain.com/index2.htm";
loadPage[2] = "http://www.mydomain.com/index3.htm";
index = Math.floor(Math.random() * loadPage.length);
document.location = loadPage[index];
}
//-->
</script>
</head>
<body onLoad="setTimeout(RandomPage()', 5000)">
<h2>Prepare to be redirected!</h2>
<p>This page is a time delay redirect!</p>

</body>
</html>


Change the setTimeout time to "0" for an instant redirect.

If you want it to alternate everyother time exactly you''ll have to use a serverside script like php (my favorite)


[edit on 3-3-2005 by dbates]



reply to this post:   copyright & usage 


reply posted on 12-4-2005 @ 10:17 PM by mickmeaney


That's awesome code dbates.. I thought I'd take it a bit further by blocking a search bot from reading it.. some engines don't like JS in pages, so it might be handy for anyone using JS in their pages.

Create a new directory and call it code (or anything you like) and save the code dbates made as a alternate.js file in notepad. Modify this HTML in your < head> tags on your index page:

< script type="text/_javascript" "_javascript" "/code/alternate .js">


Now paste this code into notepad and save as robots.txt
robots.txt
User-agent: *
Disallow: /code/

This will block all search engines from reading anything in the code folder and made the page load faster.

[edit on 12-4-2005 by mickmeaney]

[edit on 12-4-2005 by mickmeaney]



reply to this post:   copyright & usage 


reply posted on 18-4-2005 @ 08:52 PM by dbates


Interesting insight. I usually don't bother doing anyting for search engines, but then I only tinker with web pages on the side. Useful information for sure.



reply to this post:   copyright & usage 










Top Topics Right Now:



Active Topics Right Now:



ATS MIX Podcasts:





























ATS Server: www3.theabovenetwork.com
Powered by AboveTop:Board v2.3
Header data processed in 0.002 seconds
Page processed in 0.077 seconds
6 total database queries (1)









The Below Top Secret General Discussion Web site is a wholly owned social content community of The Above Network, LLC.

Documents



thread
Forums Directory