May 29, 2015
12
0
1
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
363
"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.
 
May 29, 2015
12
0
1
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
 

Attachments

May 29, 2015
12
0
1
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
363
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.
 
May 29, 2015
12
0
1
Manaus/AM - BRAZIL
cPanel Access Level
Website Owner
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
363
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:

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.
 
  • Like
Reactions: Marcello Henrique

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,910
2,216
363
I am happy to see the issue is now resolved. Thank you for updating us with the outcome.