0

i have this config on my codeigniter file :

$config['base_url'] = 'http://kandanghosting.com/mtma/';

and i set my folder like this in my server enter image description here

but still get this error

404 Page Not Found

The page you requested was not found.

my htaccess :

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

my routes :

$route['default_controller'] = 'home';
$route['404_override'] = '';
$route['translate_uri_dashes'] = FALSE;

my completed config :

$config['base_url'] = 'http://kandanghosting.com/mtma/';

$config['index_page'] = '';

$config['uri_protocol'] = 'REQUEST_URI';


$config['url_suffix'] = '';
12
  • Did you created that path while adding new domain in cPanel ? Just put a simple index.html file in same path after that try http://kandanghosting.com and http://kandanghosting.com/mtma/ let me know which url display your plane html page. Commented Nov 1, 2016 at 9:05
  • ok.. u can acces this url .. kandanghosting.com/mtma its online .. u can see it Commented Nov 1, 2016 at 9:11
  • its shows 404. so we need to evaluate config.php to understand what's wrong. Do you have .htaccess file in same folder, if so just delete temporary and retry ? Commented Nov 1, 2016 at 9:18
  • @MuhammadMuqorrobin I can see the site and access this site menu. What you want ? project have in inside of the mtma folder Commented Nov 1, 2016 at 9:20
  • You don't have any non-existent controller set as the default controller in your routes.php , right ? Like $route['default_controller'] = 'login'; Commented Nov 1, 2016 at 9:21

2 Answers 2

2

change your route

$route['default_controller'] = 'Home';
Sign up to request clarification or add additional context in comments.

4 Comments

Lower case $route['default_controller'] = 'home'; best on routes.php default_controller
@BIBINJOHN And you don't need to create another answer just edit your first answer.
I have solved this problem, please just make few changes 1- all controller class name should start with capital letter. i mean first letter of class should be capital . eg we have controler with class name Pages so it should be Pages not pages 2- save the controller class Pages as Pages.php not pages.php so first letter must be capital same for model, model class first letter should be capital and also save model class as Pages_model.php not page_model.php hope this will solve ur problem
@MuhammadMuqorrobin look at this will be help full codeigniter.com/user_guide/general/styleguide.html#file-naming
0

add this code part to your controller

public function __construct()
    {
            parent::__construct();

            $this->load->helper(array('form','url'));

    }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.