The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Apache not finding index.php by default

Discussion in 'General Discussion' started by Matt Sartori, Feb 15, 2016.

  1. Matt Sartori

    Matt Sartori Registered

    Joined:
    Feb 7, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Indianapolis, IN USA
    cPanel Access Level:
    Root Administrator
    I'm getting the following message when I'm trying to go to this url: example.com/couch/

    The requested URL /couch/.php was not found on this server.​

    Notice that it just says .php instead of index.php. I already have index.php at the top of the directory index (image below) and there is an index.php file in the directory.

    - Removed please attach images to your posts -

    I've also added the following to my root directory's .htaccess file:

    DirectoryIndex index.php

    And, going directly to example.com/couch/index.php brings me to the correct page.

    Does anyone have an idea of what I'm missing?

    Thanks!
     
    #1 Matt Sartori, Feb 15, 2016
    Last edited by a moderator: Feb 15, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Are there any additional entries in this .htaccess file, or any additional entries in .htaccess files in parent directories?

    Thank you.
     
  3. Matt Sartori

    Matt Sartori Registered

    Joined:
    Feb 7, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Indianapolis, IN USA
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    Here is my entire .htaccess file.

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^\.]+)$ $1.php [NC,L]
    DirectoryIndex index.php

    This file is in the /home/username/public_html directory and there are no .htaccess files above the public_html directory.

    Thanks!
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you temporarily remove those Mod_Rewrite rules, and test loading the page in a different browser or after clearing the cache in the existing browser?

    Thank you.
     
  5. Matt Sartori

    Matt Sartori Registered

    Joined:
    Feb 7, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Indianapolis, IN USA
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    It turns out another developer added an .htaccess file that fixed the issue so I can't troubleshoot this any further. You can close the ticket. Thanks.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    651
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page