htaccess + auto_prepend_file failuere

Discussion in 'General' started by MJuhler, Dec 30, 2012.

  1. MJuhler

    MJuhler New Member

    Hi, I have searched the forum and could not find other topics about this problem so I hope someone can help me.

    In the /www I have a htaccess file containing the following:
    php_value auto_prepend_file ../design/header.php
    php_value auto_append_file ../design/footer.php

    and it works fine, my problem is that when I call a page "list.php" located in /www/callback folder via "$("#show").load("callback/list.php");" so problems arise.
    *
    in callback folder is a htacces file with the following content:
    php_value auto_prepend_file none
    php_value auto_append_file none

    and even to the rims htaccess file in the callback folder should not throw design of the file list.php then throw the design of anyway via htaccess file from the /www

    It has worked in the past when we used Apache as web server, I hope there is someone who can help me :confused:
  2. webizen

    webizen New Member

    Please elaborate how you call list.php. What script language is this "$("#show").load("callback/list.php");"?
  3. MJuhler

    MJuhler New Member

    sorry, the page is in php with javascript

    <div id="show"></div>
    <script type="text/javascript">
    jQuery(function($) {
    $("#show").load("callback/list.php");
    interval_stats = setInterval("$('#show').load('callback/list.php');", 5000);
    });
    </script>
  4. MJuhler

    MJuhler New Member

    I really need help to solve this problem
  5. NiteWave

    NiteWave Administrator

    not clear about:
    can you be more specific ?
  6. MJuhler

    MJuhler New Member

    htaccess file in callback folder has:
    php_value auto_prepend_file none
    php_value auto_append_file none
    ie. files in this folder are not put on design.

    However, the files in callback folder is being put design on by the htaccess file from the www folder, this did not happen on apache.

    it seems like the htaccess file located in the callback folder has no effect as soon htaccess file from the www folder is loaded
  7. NiteWave

    NiteWave Administrator

  8. MJuhler

    MJuhler New Member

    Files in the callback folder has to be loaded by this script

    <div id="show"></div>
    <script type="text/javascript">
    jQuery(function($) {
    $("#show").load("callback/list.php");
    interval_stats = setInterval("$('#show').load('callback/list.php');", 5000);
    });
    </script>

    when the files is loaded and showen in the div is has the design 2 times, first time on the file test.php in the www dir, and design again on the file list.php in the www/callback folder (where the htaccess file is set not to apped the design.

    [​IMG]
    Last edited: Jan 6, 2013
  9. NiteWave

    NiteWave Administrator

    here's testing source code: /test.php
    PHP:
    <script type="text/javascript" src="jquery.js">
    </script>
    <div id="show"></div>
    <script type="text/javascript"> 
    jQuery(function($) {
    $("#show").load("callback/list.php");
    interval_stats = setInterval("$('#show').load('callback/list.php');", 5000);
    });
    </script>

    the result is expected:
    --- design header ---
    --- callback/list.php -----
    --- design footer ---
  10. MJuhler

    MJuhler New Member

    I do not understand why it teases with me if it works with you ... how does your htaccess file in the www folder and the callback folder?

    Do you have something special in your server config?
  11. NiteWave

    NiteWave Administrator

    /usr/local/lsws/DEFAULT/html>cat .htaccess
    php_value auto_prepend_file ../design/header.php
    php_value auto_append_file ../design/footer.php

    /usr/local/lsws/DEFAULT/html/callback>cat .htaccess
    php_value auto_prepend_file none
    php_value auto_append_file none

    /usr/local/lsws/DEFAULT/html/callback>cat list.php
    PHP:
    <?php
    echo "--- callback/list.php -----<br>";
    ?>
    just what you've suggested.

    check:
    http://php.net/manual/en/configuration.changes.php
  12. MJuhler

    MJuhler New Member

    "AllowOverride All" in the webserver/vhost config or in the htaccess file?
  13. NiteWave

    NiteWave Administrator

Share This Page