1

i want to removing index.php in hmvc code igniter , when i type the url without index.php it's running well but when i process to other controller the url is automatically showing index.php after my codeigniter folder.

example i type :

localhost/ci_hmvc/user/login 

and the result when i process to other controller is :

localhost/ci_hmvc/index.php/user/dashboard

and my .htaccess

<IfModule mod_rewrite.c> 
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /ci_hmvc/index.php/$1 [L]
</IfModule>

please any one help me

Gusti Erlangga
  • 69
  • 1
  • 12

2 Answers2

0

You can make changes in config.php which is in config folder You can see the line

$config['index_page'] = 'index.php';

Change this line in to

$config['index_page'] = '';

I hope this will helps you

ubm
  • 636
  • 11
  • 21
0

put this code in .htaccess and place the htaccess file to the root of the folder..

DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]