How can I have my home page open up to a random page?

advertisement
Twinfun asked:


I’d like when people come to my site to have a different home or landing page open every time. For example, when they type in www.mydomainname.com, they will see a different page every time. I have a lot of possible pages (over 100K) that I want to pop open. Is there a script I can use on my index.com file that would point to a file that has all my possible opening pages? Or is there some other way that would be easy and not involve manually typing in over 100K addresses in a Javascript?

Many thanks!

Blog Marketing

Related Posts

        
advertisement

3 Responses to “How can I have my home page open up to a random page?”

  1. 3 way link Says:

    Web Search Engine Marketing

    Where is this list of 100K addresses?
    It is conceivable to write an AJAX web page, such that the javascript request for a XML page with the 100K addresses, and then randomly goes to one of them.
    However, that said, you still need to have the 100K addresses somewhere.

  2. Learn SEO Says:

    DIY Solar Power

    I’ve found this code for you

    Page randomizer

    If script doesn’t work, return to:
    example.com

  3. Solar Power for Home Says:

    Link Building Service

    If you mass rename your landing page files to follow a numbered scheme, you can avoid typing them into JavaScript or even loading the filenames explicitly altogether.

    ~~~~~~~~~~~~~~~

    // set the value of {pageCount} to be
    // the total number of alternate pages
    // to which to direct the visitor
    var pageCount = 100000;

    // generate a random value on the interval
    // [0, pageCount-1]
    var r = (pageCount-1)*Math.random();

    // round the random variable to the nearest
    // whole number (r may have a fractional
    // part)
    var i = Math.floor(.5 + r);

    // all pages that serve as landing should
    // be named like page###.html, where the
    // ### is the number, e.g., 0-99999 (or
    // whatever your actual page count is), of
    // a particular page file, e.g., for 100K
    // files, your files’ names would be:
    // page0.html, page1.html, page2.html,…
    // page99999.html
    // construct a string for the name of
    // the file that corresponds to the current
    // random number
    var p = ‘page’ + i + ‘.html’

    // change the location to the selected
    // page
    window.location = p;

    Don’t need any content here.

Leave a Reply