It looks like you're using an Ad Blocker.

Please white-list or disable in your ad-blocking tool.

Thank you.


Some features of ATS will be disabled while you continue to use an ad-blocker.


Alternating homepages?

page: 1

log in


posted on Mar, 3 2005 @ 01:10 PM
Does anyone know if its possible to have alternating homepages?

posted on Mar, 3 2005 @ 01:29 PM
You could probably do a random home page with Javascript.
Use the following code for your "index.html" page.

< html >
<script type="text/_javascript">
function RandomPage()[
loadPage[0] = "";
loadPage[1] = "";
loadPage[2] = "";
index = Math.floor(Math.random() * loadPage.length);
document.location = loadPage[index];
<body ="setTimeout(RandomPage()', 5000)">
<h2>Prepare to be redirected!</h2>
<p>This page is a time delay redirect!</p>


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]

posted on Apr, 12 2005 @ 10:17 PM
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
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]

posted on Apr, 18 2005 @ 08:52 PM
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.

top topics

log in