Why am I encountering 404 errors with CodeIgniter controllers on a new server? |
I encountered an interesting issue while transferring a fully functional CodeIgniter app to a new server. After updating the base URL in the config.php file and configuring the database parameters accordingly, I'm facing a problem where all controllers I attempt to access on the new server result in a 404 error. However, when I navigate to the base URL, the default controller (welcome.php) defined in routes.php renders correctly in the browser.
Based on this observation, it appears that CodeIgniter is running properly on the new server, but there may be an underlying routing issue that I haven't been able to identify. My current .htaccess file contains the following code: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?/$1 [L] This .htaccess configuration worked fine on the previous server. However, I'm uncertain about what might be causing the problem on the new server. I would greatly appreciate any insights or suggestions regarding what I might be doing wrong in this situation. PHP Code: RewriteRule ^(.*)$ /index.php?/$1 [L] What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |