Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeigniter 404 error page, routing issue

Tags:

codeigniter

I have uploaded my web project using codeigniter on the server godaddy and I can access it thru this link http://izhi-ks.org/facelajm/blog

I have bought a new domain www.facelajm.com for this site, and I have updated the directory to /facelajm and I get 404 Page Not Found error.

so my ftp looks like this:

in the root I have another site which is joomla and within that dir I ahave a folder called facelajm.

In the codeigniter root dir i have a .htaccess like this:

RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteRule ^(.*)$ index.php?/$1 [L]

What I am doing wrong, that I cant open the site only by typing www.facelajm.com In fact it does if i only create a new index.php and print hello world... I am doubting on the htaccess or maybe config file?

here is config.php as well:

$config['base_url'] = "";

$config['index_page'] = '';

$config['uri_protocol'] = 'AUTO';
like image 583
Lulzim Avatar asked Jun 08 '26 11:06

Lulzim


2 Answers

Change your .htaccess in the facelajm directory (which should be the root of your domain) to the following. I think you forgot to turn on RewriteEngine and forgot to set RewriteBase:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

Update

A default controller needs to be set in routes.php

$route['default_controller'] = 'blog';
like image 120
doitlikejustin Avatar answered Jun 10 '26 04:06

doitlikejustin


If you using Codeigniter V3, check the first letter of your controller is in upper case, example:

 ci/application/controllers/dealer/Api.php 
like image 20
Vladymir Gonzalez Avatar answered Jun 10 '26 04:06

Vladymir Gonzalez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!