Remove index.php from URL (CodeIgniter)

2019-07-20 21:16发布

问题:

I've removed the index.php throught this code:

RewriteEngine on
RewriteCond $1 !^(index\.php|assets|robots\.txt)
RewriteRule ^(.*)$ /leet/index.php/$1 [L]

But when I submit form <?=form_open('signup');?> and the page refreshes the url changes its value to localhost/ci/index.php/signup.

Is it possible to remove it?

回答1:

You must check your config.php inside your application\config directory, as you can see, locate your

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

Change that to

$config['index_page'] = '';

I hope it helps!