CodeIgniter Forums
[RESOLVED] 404 on production - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: [RESOLVED] 404 on production (/showthread.php?tid=62756)



[RESOLVED] 404 on production - maxime59 - 08-22-2015

Hi at all,

Looks like it's a recurrent issue but I still can't solve it so this is my story :

- Project on development environment works well, routes defined without the index.php in it.
- Migration on "production" and 404 error when index.php not used !
--> I can't access to my pages without index.php in the URI whereas in development it worked normally.

Not Found

The requested URL /dashboard was not found on this server.
Apache/2.2.15 (CentOS) Server at prod.grm.com Port 80


Module_rewrite is right there (checked with phpinfo())
My Controllers and Models are written with a first Capital letter.
I changed the config['base_url'] with the the production one

--> Also, the homepage works with default controller set but after it's 404..

Htaccess problem ?

I can't get it why so much difference between development and "prod".

Thanks

Max


RE: 404 on production - phplaw - 08-22-2015

The problem because of htaccess has wrong config, open your htaccess file, then add this ./ before index.php/$1 to resolve your problem.
After add that the line look like this:
Code:
./index.php/$1



RE: 404 on production - maxime59 - 08-23-2015

Hello,

It seems that adding the './' before index.php/$1 doesn't work as I still have 404..

This is my final htaccess file :

RewriteBase /
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]


RE: 404 on production - phplaw - 08-23-2015

After add './' , please remove this line
Code:
RewriteBase /
then It will work.


RE: 404 on production - maxime59 - 08-23-2015

Hey,

I finally found that the problem came from my httpd.conf file, add to change the AllowOverride All in <Directory "/var/www/html">

Found here : http://stackoverflow.com/questions/20710569/codeigniter-url-rewriting-htaccess-is-not-working-on-centos

Thanks for the help


RE: [RESOLVED] 404 on production - phplaw - 08-23-2015

Dude, some how you guy put out the wheels on your car then trying to drive It to the store =))