Codeigniter shared hosting 404 error |
Hi all,
I am working with codeigniter 3.1.X.Everything is fine in localhost.All working normal with controllers and views.But when i hosted my application in hostgator cPanel the controllers stopped working and 404 error giving.The default controller working but no other controller is working.My .htaccess of application folder is as follows <code> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] <IfModule authz_core_module> Require all denied </IfModule> <IfModule !authz_core_module> Deny from all </IfModule> it is very fine working in local host in all systems but not when hosted through Cpanel. Please help me in this regard i have tried REQUEST_URI index page index.php. I have checked for Mod_rewrite enable and it is also fine </code>
I have shared hosting and my CodeIgniter runs just fine.
Check to see if it is expecting all lower case filenames etc; What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
The most common reason why "it works on localhost, but gives 404 on the live site" is a failure to follow CodeIgniter's file naming requirements.
This happens a lot to devs where localhost is no a Windows system and the live server is Linux. The first OS is a case-insensitive, but the later is case-sensitive.
(05-15-2019, 07:10 AM)dave friend Wrote: The most common reason why "it works on localhost, but gives 404 on the live site" is a failure to follow CodeIgniter's file naming requirements.But I have tried all..nothing working
it is worked once if i changed .htaccess of root folder o the following
Code: RewriteEngine On Code: $config['index_page'] = ''; but only one request it worked fine and total site is hanged..even now home page or any static page is also not working. any body help
@srmarasu84,
Can we see the model, view and controller for one of the pages that is receiving a 404 error?
Thank god finally it worked..adding .htaccess in root folder is required and no need to add index.php in url.
It is working fine now..thanks to all for quick replies |
Welcome Guest, Not a member yet? Register Sign In |