Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Member
    Join Date
    Jan 2003
    Posts
    30
    Member #
    459

    Current Rating

    Visual Appeal:
    0.0 out of 5

    Accessibility:
    0.0 out of 5

    Website Speed:
    0.0 out of 5

    Compatibility:
    0.0 out of 5

    Overall Rating:
    0.0 out of 5

    Rate This Site


    Advertisement (login to hide this!)


    You must be logged in to view this site

    Is there any way you can have 2 index.html files for one site. The reason for this is I would like to be able to offer visitors to my site a different web page each time.

    e.g. user type in www.cyberstyle.it

    and are directed (automatically) to :

    http//www.cyberstyle.it/index.html
    or
    http://www.cyberstyle.it.index2.html

    and if required more index files

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Make one master index.html (ideally PHP or some server-side thing so it's not a client-side redirect) that redirects to the appropriate file. Just like any other filesystem you can't have two of the same filename in the same directory.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Or, you could just make an index.asp or index.php file or something like that with a dynamic area in it.

    Even easier (if you don't know how to program) would be to create an index.html with multiple divs of content and javascript that decides which div to display (based off a random sequence).

    Try something like this:

    Code:
    <html>
    <head>
        <script type="text/javascript" language="javascript">
            function showRandomContent() {
                var x;
                x = Math.ceil(3 * Math.random());
                document.getElementById('area' + x).style.display = '';
            }
        </script>
    </head>
    <body onload="showRandomContent()">
        <div id="area1" style="display:none">
            <p>This is your content for area 1</p>
        </div>
        <div id="area2" style="display:none">
            <p>This is your content for area 2</p>
        </div>
        <div id="area3" style="display:none">
            <p>This is your content for area 3</p>
        </div>
    </body>
    </html>
    I think that should suit your purposes.

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    You could put an index.html file in each of two or more separate directories (e.g. http://www.cyberstyle.it/dir1/index.html and http://www.cyberstyle.it/dir2/index.html)
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    GAME,

    I think that would just complicate the issue. Also, it would require redirecting from the root index page, which looks REALLY BAD to search engines.

    Using the method I put above should work really well. Additionally, it will double the search engine readable content he has on his homepage

  7. #6
    Senior Member splufdaddy's Avatar
    Join Date
    Feb 2003
    Location
    Boston, MA
    Posts
    4,488
    Member #
    735
    That's an cool method transio. However, if he had alot of content for site 1, and alot of content for site 2, won't your method load all of the content, and then show half of it?
    I do like that approach though for changing small amounts of content, like headings, greetings, etc. I'll remember that. ::mentally filed::

  8. #7
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Actually, it won't show anything until the page is loaded, then it will display the randomly selected choice.

    It would work well for text. Poorly for images, since it would load ALL the images before displaying only HALF of them.

  9. #8
    Senior Member splufdaddy's Avatar
    Join Date
    Feb 2003
    Location
    Boston, MA
    Posts
    4,488
    Member #
    735
    What I meant is that the two content choices are loaded by the browser, and then half is displayed on the screen. If you did a view source, would you see the div 1 w/ display set to none, and then the div 2 with display set to true b/c it was randomly selected? To ask this confusing question another way, if he has 10 choices, and each is 2 paragrahs, will 20 paragraphs be sent from the server to the client, and then the client will decide which 2 paragraphs to display? Am I way off? (of course, i'm explaining it clear as mud )

  10. #9
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,483
    Member #
    425
    Liked
    2783 times
    transio:

    Yes, my method isn't as search-engine friendly (and I personally would employ a script-based method) but it is more "I can do it in 5 minutes" friendly, which may be all the guy's trying to accomplish at this stage. After all, the more options he has to choose from, the more likely he is to get what he wants, right?
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  11. #10
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    True indeed


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:29 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com