• 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'default_controller' in codeingter3 HMVC is not working

Hi, In my project, I am using CI3 HMVC. Now, I am facing problem with routing. I want users to type www.demosite.com and that take them or call my home module. I do not want to show like www.demosite.com/home. I want to show the url like www.demosite.com. for this, I set default controller in application/config/routes, like this

$route['default_controller'] = "home";

also in my home module, I added a route folder where I wrote

$route['home'] = "home";

here is my .htaccess

AddType text/x-component .htc
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond $1 !(index\.php|assets/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]


and here is my home controller

class Home extends MX_Controller{
  function __construct(){


  function index($stub=""){

      echo $this->_showHomepage();     


When I run this, I got 404 error. Please help me to solve this problem.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.