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.

index.php not found in cpanel, error 404

Discussion in 'General Discussion' started by Marcello Henrique, May 29, 2015.

  1. Marcello Henrique

    Joined:
    May 29, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manaus/AM - BRAZIL
    cPanel Access Level:
    Website Owner
    Hi, i have a project using codeigniter and i'm trying to configure my cPanel server. but i'm getting some problems...

    In my localhost, i can access the webpages with no problem.
    but when i try on the server, an error 404 appears.

    "The requested URL /home/teste2/pqr/public_html/myProject/index.php was not found on this server."

    this is my .htaccess
    RewriteEngine On

    RewriteRule ^index.php/(.*)$ /$1 [R=302,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|images|robots\.txt)
    RewriteRule ^(.*)$ index.php?/$1 [L]

    If i remove this line RewriteRule ^index.php/(.*)$ /$1 [R=302,L]
    i manage to access the pages but only adding index.php in the url
     
  2. 24x7ss

    24x7ss Well-Known Member

    Joined:
    Sep 30, 2014
    Messages:
    271
    Likes Received:
    16
    Trophy Points:
    18
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi,

    Comment out RewriteRule ^index.php/(.*)$ /$1 [R=302,L] and add below code,

    DirectoryIndex index.php
     
    madmanmachines likes this.
  3. Marcello Henrique

    Joined:
    May 29, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manaus/AM - BRAZIL
    cPanel Access Level:
    Website Owner
    i made the changes but i still have the same error.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Have you verified this is the correct path for the index.php file? For instance, have you created an alternate document root for your domain name (e.g. the default is /home/$username/public_html)?

    Thank you.
     
  5. Marcello Henrique

    Joined:
    May 29, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manaus/AM - BRAZIL
    cPanel Access Level:
    Website Owner
    yes. it's correct! (look the screenshot)
    -
    if i remove the RewriteRule line , the error changes...
    The requested URL /~pqr/praquerumo/controller/attribute was not found on this server.

    the url is right, but the page isnt displayed.
    if i put index.php on the url, /~pqr/praquerumo/index.php/controller/attribute the pages opens normally
     

    Attached Files:

  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    The error message indicates you are using Apache Mod_UserDir to access the website. Have you tried accessing the domain name directly?

    Thank you.
     
  7. Marcello Henrique

    Joined:
    May 29, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manaus/AM - BRAZIL
    cPanel Access Level:
    Website Owner
    i'm with mod rewrite enabled, if you access domain.com/~pqr/praquerumo/ it'll work.
    but, if you try to click on an activity, the error will appear
     
  8. Marcello Henrique

    Joined:
    May 29, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manaus/AM - BRAZIL
    cPanel Access Level:
    Website Owner
    i've downloaded a new codeigniter project and put this .htacess

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]

    works on my localhost, and isnt working on the server.
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you clarify if you are using Apache Mod_UserDir to access the content? It's known to have compatibility issues with Mod_Rewrite rules. It's better to modify the hosts file on your computer to preview the site before changing the name servers.

    Thank you.
     
  10. Marcello Henrique

    Joined:
    May 29, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manaus/AM - BRAZIL
    cPanel Access Level:
    Website Owner
    where i can check it? sorry i'm newbie.
    i asked the webmaster, and i'm waiting his answer

    *update: i asked the webmaster to disable Mod_UserDir, but it didnt change anything*
     
    #10 Marcello Henrique, Jun 2, 2015
    Last edited: Jun 2, 2015
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    What do you see in your browser address bar (replace the actual domain name or IP with an example)?

    Thank you.
     
  12. Marcello Henrique

    Joined:
    May 29, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manaus/AM - BRAZIL
    cPanel Access Level:
    Website Owner
    http:/server.com/~user/project/controller/attribute
     
  13. Marcello Henrique

    Joined:
    May 29, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manaus/AM - BRAZIL
    cPanel Access Level:
    Website Owner
    http:/server.com/~user/project/controller/attribute

    Error message
    The requested URL /home/teste2/user/public_html/project/index.php/controller/attribute was not found on this server.

    my htacess is with 755 permission.
    i've already changed to 777 (for tests) and the errors changes to an error 500.
     
  14. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You will need to use the actual domain name instead of the Mod_Userdir URL to ensure compatibility with Mod_Rewrite rules. EX:

    Code:
    domain.com/project/controller/attribute
    Have you changed the name servers for this domain name yet so it points to your server?

    Thank you.
     
    Marcello Henrique likes this.
  15. Marcello Henrique

    Joined:
    May 29, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manaus/AM - BRAZIL
    cPanel Access Level:
    Website Owner
    well, my domain is pointing to another server.
    maybe it could be the reason. i'm gonna change it and i'll tell you if it worked or not.
     
  16. Marcello Henrique

    Joined:
    May 29, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manaus/AM - BRAZIL
    cPanel Access Level:
    Website Owner
    changed my domain's pointing and it's working!
    but, not in my subdomain! ahhhahahh
     
  17. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Did you change the name servers, or simply update the "A" record at your DNS provider? If you only changed the "A" record, then you must also do so for each subdomain entry.

    Thank you.
     
  18. Marcello Henrique

    Joined:
    May 29, 2015
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Manaus/AM - BRAZIL
    cPanel Access Level:
    Website Owner
    well,
    everything is working fine.
    i think the dns has taken a little bit time to solve my subdomain.
     
  19. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

Share This Page