Reputation: 19
I have a little problem with Code Igniter project, I have a .htaccess file to rewrite the index.php. It works great if I put my projects on Local Server. I am using WAMP Server. But now I have uploaded it on Live Server for example (godaddy,00webhost). And it is showing error : 404 Page Not Found.The page you requested was not found.
My .htaccess is here :
RewriteEngine on
RewriteBase /directory_name/
RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
and my config.php setting is here:
$config['base_url'] = 'http://example.com/directory/' ;
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
I have tried many solutions on web but not enough lucky to find one who helps me. I am stuck since 3 days. Anyone Help me.
Upvotes: 0
Views: 1370
Reputation: 13635
If you are trying to host the website in a subfolder, make sure you enter the correct info in your htaccess and config:
Change RewriteBase /directory_name/
in htaccess to RewriteBase /ci_foam/
Change $config['base_url'] = 'http://example.com/directory/'
in your config to $config['base_url'] = 'http://php0713061.herobo.com/ci_foam/'
You always need to make sure these values matches your current server setup.
Upvotes: 1