Problems with index.htm

Discussion in 'Apache' started by freddo, Mar 17, 2006.

  1. #1
    Apologies in advance if this question has already been answered
    somewhere in here, was unable to find an answer. I have the following
    scenario:

    o A live site, let's call it http://www.mydomain.com/
    o A default index page at http://www.mydomain.com/index.php

    The site works fine and the index.php page loads as it should according
    to Apache defaults. It has a few buttons doing form posts for search
    functionality etc.

    Now, for various obscure reasons, I want to change the scenario so that
    I instead load a static index.html page that in turn contains a FRAMESET
    element. One of the frames in the frameset would contain the index.php
    page described above and take up all visible space in the browser.
    There would be an additional zero size frame with some metadata.

    To accomplish this I made the following changes:

    o Enable an .htaccess file in the root of the web site. The .htaccess
    has a DirectoryIndex directive which internally loads the index.html
    page when you hit http://www.mydomain.com/
    o Created the index.html page with the frameset and added the two
    required frames to it. One of them being the index.php

    Now when I hit http://www.mydomain.com/, the frameset page gets loaded.
    So far so good. But when I hit any buttons that do form posts on the
    visible part of the page (generated by the index.php) all the posts
    fail. Ok, so maybe there is a frame dependency in some script or the
    php page that receives the post etc etc somewhere and this is messing
    things up, so I tried going directly to the frameset page at:

    http://www.mydomain.com/index.html

    and when I do this the posts work fine. This really blows my mind. To
    recoup, when I go to:

    http://www.mydomain.com/

    and apache internally loads the index.htm because of the DirectoryIndex
    directive things do not work. When I manually go to the index.htm page
    by writing:

    http://www.mydomain.com/index.htm

    in the adress bar, things work fine. This is also the case when I set index.html as default via the httpd.conf.

    Now, I'm somwehat novice at apache, but as far as I understand the two scenarios should load the page in exactly the same way. What am I missing here? What is the difference in the state of the page between the two ways of loading the page? I'm completely stomped and I've tried about a gazillion
    permutations of tings to get this working...any help greatly
    appreciated.
     
    freddo, Mar 17, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Make sure you are using absolute urls in the form tags.

    eg
    <form action="http://www.domain.com/file.php3" action="post">
    Code (markup):
     
    mad4, Mar 17, 2006 IP
  3. freddo

    freddo Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Tried now with the absolute paths in the <form> but that doesnt work. I really cant understand why the site works perfectly if I write absolut adress but not when I set inmdex.html as default.
     
    freddo, Mar 18, 2006 IP
  4. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Have you got a url so I can see the form in action? PM me if you want.
     
    mad4, Mar 19, 2006 IP