In my development environment (Mac OS, Apache, CI app inside a WP folder) my app works fine. Today I deployed it to server (Ubuntu Server, Apache, same CI app inside WP folder) and everything that I try return the 404 page.
This is my app/.htaccess:
SetEnv CI_ENV development
RewriteEngine on
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
mod_rewrite is already enabled in this server.
In my config.php I’ve already tried:
$config['base_url'] = 'http://server/app/';
// problem in both situations
$config['index_page'] = 'index.php';
$config['index_page'] = '';
What is wrong here? When I go to http://server/app/index.php I get a 404 message. If I go to http://server/app/controller/action I also get a 404 message.
Change this
In your
config.php
$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
then in
.htaccess
( ** this should be place out side of application folder ** )Read this as well
I had same issue. Just change the file permission to 644 to index.php
When I pull the changes via git. permission change to 664 so change back to 644. Hope this will solve issue.
Try removing the SetEnv . You can set the environment in the index.php file.
For the base_url, make sure it is the folder level that the index.php page is in.
/app/ should contain the application folder.
For the index_page, I would not set this to blank. Put it back to ‘index.php’;
Try this in your htaccess,
You may not need to include the application folder in the RewriteCond but try it anyway.
make sure you default_contoller is set in your /config/routes.php file.
Solved:
I just discovered that controller’s file must have names with capital letters.
http://www.codeigniter.com/user_guide/general/controllers.html