Welcome Guest, Not a member yet? Register   Sign In
[RESOLVED] 404 on production
#1

(This post was last modified: 08-23-2015, 12:19 PM by maxime59.)

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
Reply
#2

(This post was last modified: 08-22-2015, 10:13 PM by phplaw.)

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
Reply
#3

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]
Reply
#4

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

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/20710...-on-centos

Thanks for the help
Reply
#6

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




Theme © iAndrew 2016 - Forum software by © MyBB