Results 1 to 2 of 2

Thread: directoryindex problem in htaccess

  1. #1
    Join Date
    Sep 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default directoryindex problem in htaccess

    hello to all,
    I have used following codes in my htaccess file:

    DirectoryIndex folder/index.php

    such that when www.mysite.com is entered,
    the page www.mysite.com/folder/index.php is opened and
    www.mysite.com/index.php is seen in my address bar

    But what happens is, all the subfolder within the root use the same htaccess file and all the subfolders tend to search file '/folder/index.php' which I don't want.
    Is there any way to use the above code for only the root?
    Thanx in advance

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    You can put AllowOverride directives inside <Directory> containers in httpd.conf, with the <Directory> containers specifying directories which can and/or cannot use .htaccess. Example:

    Code:
    # Default to allow all to use .htaccess
    <Directory /*>
    AllowOverride All
    </Directory>
    #
    # Disable .htaccess in this path
    <Directory /cannot/use/htaccess/*>
    AllowOverride None
    </Directory>
    #
    # But turn some features back on for this one dir in the above path
    <Directory /cannot/use/htaccess/but-this-one-can/*>
    AllowOverride FileInfo Options
    </Directory>
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •