SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast xarzu's Avatar
    Join Date
    Apr 2007
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    the index file access in a browser

    Hello Forum!

    My problem is if I go to my new installation root director, http://www.arguemax.com/_phpBB-3.0.12/ nothing happens and I get a "Forbidden" message, but if I put the index path in the URL of the browser, it works. That is, http://www.arguemax.com/_phpBB-3.0.12/index.php makes the phpbb load. Why is this and do I really need to be concerned about this? Should I just use http://www.arguemax.com/_phpBB-3.0.12/index.php in all my links on the landing page? I had a look at the .htaccess of this folder and I did not see any mention of an expected index file. Should I put something there?

    Thanks in advance, gurus.

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2005
    Posts
    1,833
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    It sounds like your server's configuration for DirectoryIndex does not have index.php specified. So it does not load it. I assume you are using Apache. The DirectoryIndex directive tells the server which file to serve if no file is specified such as when typing your domain name or a folder.

    http://httpd.apache.org/docs/2.2/mod...directoryindex

    So try putting this in your .htaccess file:

    Code:
    DirectoryIndex index.html index.htm index.php
    If no file is specified, the server will load index.html, index.htm, or index.php if they exist.

  3. #3
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    cd,



    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  4. #4
    SitePoint Enthusiast xarzu's Avatar
    Join Date
    Apr 2007
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by cheesedude View Post
    It sounds like your server's configuration for DirectoryIndex does not have index.php specified. So it does not load it. I assume you are using Apache. The DirectoryIndex directive tells the server which file to serve if no file is specified such as when typing your domain name or a folder.

    http://httpd.apache.org/docs/2.2/mod...directoryindex

    So try putting this in your .htaccess file:

    Code:
    DirectoryIndex index.html index.htm index.php
    If no file is specified, the server will load index.html, index.htm, or index.php if they exist.

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2005
    Posts
    1,833
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Putting the DirectoryIndex directive in the server's configuration file is best. But if you do not have access to it, htaccess will have to do.

  6. #6
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,173
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    Yes, eg my localhost Apache httpd.conf file has
    Code:
    #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #
    <IfModule dir_module>
        DirectoryIndex index.html index.php
    </IfModule>
    but if you're on a shared host. htaccess is probably th best you can do.

  7. #7
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Mittineague View Post
    Code:
    #
    # DirectoryIndex: sets the file that Apache will serve if a directory
    # is requested.
    #
    <IfModule dir_module>
        DirectoryIndex index.html index.php
    </IfModule>
    but if you're on a shared host. htaccess is probably th best you can do.
    ... BUT Don't use the <IfModule ...> wrapper in your .htaccess file! Find out whether it works (ONCE) so Apache doesn't have to run the same test MULTIPLE TIMES for EVERY request!

    Note: It does belong in the server's conf file as Mitt has it because it's only run on start.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


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
  •