index.php not found in cpanel, error 404
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
-
Hi, Comment out RewriteRule ^index.php/(.*)$ /$1 [R=302,L] and add below code, DirectoryIndex index.php 0 -
i made the changes but i still have the same error. 0 -
"The requested URL /home/teste2/pqr/public_html/myProject/index.php was not found on this server."
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.0 -
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 0 -
The requested URL /~pqr/praquerumo/controller/attribute was not found on this server.
The error message indicates you are using Apache Mod_UserDir to access the website. Have you tried accessing the domain name directly? Thank you.0 -
The error message indicates you are using Apache Mod_UserDir to access the website. Have you tried accessing the domain name directly? Thank you.
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 appear0 -
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. 0 -
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. 0 -
Could you clarify if you are using Apache Mod_UserDir to access the content?
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*0 -
where i can check it? sorry i'm newbie.
What do you see in your browser address bar (replace the actual domain name or IP with an example)? Thank you.0 -
http:/server.com/~user/project/controller/attribute 0 -
What do you see in your browser address bar (replace the actual domain name or IP with an example)? Thank you.
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.0 -
http:/server.com/~user/project/controller/attribute
You will need to use the actual domain name instead of the Mod_Userdir URL to ensure compatibility with Mod_Rewrite rules. EX:domain.com/project/controller/attribute
Have you changed the name servers for this domain name yet so it points to your server? Thank you.0 -
Have you changed the name servers for this domain name yet so it points to your server?
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.0 -
changed my domain's pointing and it's working! but, not in my subdomain! ahhhahahh 0 -
but, not in my subdomain! ahhhahahh
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.0 -
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.
well, everything is working fine. i think the dns has taken a little bit time to solve my subdomain.0 -
I am happy to see the issue is now resolved. Thank you for updating us with the outcome. 0
Please sign in to leave a comment.
Comments
18 comments