Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeigniter 500 internal server error due to index.php

I am working with codeigniter framework, and as I upload it to a host, it gave me a 500 Internal error.

But when I add index.php to config.php , it worked.

What should I do?

In my .htaccess I have this:

RewriteEngine On

RewriteBase /ci-framework/

And also when I clean /ci-framework/ from end of RewriteBase it doesn't work.

Thank you very much.

like image 365
Vahid Najafi Avatar asked Jan 30 '15 23:01

Vahid Najafi


People also ask

How to solve 500 internal server error in PHP CodeIgniter?

If the CodeIgniter is of an old version, we would see similar error with the updated PHP versions. Hence, setup the PHP to a lower version. Removing the line from the configuration file LoadModulerewrite_module modules/mod_rewrite.so fixed the issue.

What is http500?

The HTTP status code 500 is a generic error response. It means that the server encountered an unexpected condition that prevented it from fulfilling the request. This error is usually returned by the server when no other error code is suitable.


1 Answers

You don't need to add index.php in config.php file. Make sure you have following line in .htaccess file:

<IfModule mod_rewrite.c>
  RewriteEngine On  
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
like image 199
kbhatta Avatar answered Oct 09 '22 04:10

kbhatta