我当前的网址看起来像这样[mysite] index.php / [其余内容]。我想从这些网址中删除index.php

时间:2019-06-17 10:54:01

标签: php html css codeigniter

我当前的网址看起来像这样[mysite] index.php / [子弹的其余部分]。我想从这些网址中删除index.php。

Screenshot

.htccess代码文件包含

RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 

我的Config.php代码

$config['base_url'] = 'http://localhost/html_task';
$config['index_page'] = '';

仍然无法正常工作。我要去哪里错了?

1 个答案:

答案 0 :(得分:-1)

在.htaccess文件中尝试以下代码

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