从URL中删除index.php(CodeIgniter)

njthzxwz  于 2022-12-07  发布在  PHP
关注(0)|答案(2)|浏览(98)

我已经通过以下代码删除了index.php:

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

但是,当我提交表单<?=form_open('signup');?>并且页面刷新时,url的值更改为localhost/ci/index.php/signup
有可能把它取下来吗?

ndh0cuux

ndh0cuux1#

您必须检查application\config目录中的config.php,如您所见,找到您的

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

更改为

$config['index_page'] = '';

希望能帮上忙!

p1tboqfb

p1tboqfb2#

使用方法如下:

<?= form_open_multipart(base_url().'/controller_name/function_name') ?>

希望对你有帮助。

相关问题