removing index.php in hmvc

918 Views Asked by At

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

2

There are 2 best solutions below

1
ubm On BEST ANSWER

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

0
Ramanjit Singh On

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]