Internal Server Error in codeigniter on live host

Viewed 7704

I have deployed a website that uses CodeIgniter in the main public_html folder (http://www.myexample.com). This project working perfectly on localhost. In order to remove index.php from URL this has the following .htaccess:

RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt) 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

However, when I try to go to the website I'm getting an Internal Server Error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@its.org.pk to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I have applied differently .htaccess files but getting the same error.

5 Answers

If you are on Ubuntu 16.04, 18.04 or 20.04 try this-

sudo a2enmod rewrite and restart your apache server systemctl restart apache2

I hope it will solve your issue, it works for me.

Update June 2021

I just figured out that after verifying DB credentials correctly, the .htaccess file is mostly the one causing trouble. I deleted what i had on cpanel and uploaded another Boom It worked!

Just for future users

Related