首页 > 解决方案 > 我无法从 codeigniter 3.1.11 中的 URl 中删除 index.php

问题描述

我尝试从可用的文档中将.htaccess添加到根文件夹中。我搜索了整个互联网,但没有解决我的问题。

.htaccess 中的代码

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

更改了 apache 文件httpd

LoadModule rewrite_module modules/mod_rewrite.so

谁能告诉我可能是什么原因?

标签: php.htaccesscodeigniter

解决方案


Find the below code
 $config['index_page'] = "index.php"
Remove index.php
$config['index_page'] = ""

在 .htaccess 文件中写入以下代码

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

推荐阅读