如何从codeigniter中的URL中删除index.php?

问题描述:

以下代码在我的.httaccess文件中.

The following code is in my .httaccess file.

#write your project folder name as rewritebase
RewriteBase /Codeignitor3D/

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

给出500个内部服务器错误

It's give the 500 internal server error

尝试以下规则:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

在您的 config.php 文件中,

//Find   
$config['index_page'] = "index.php" 
//and replace it with
$config['index_page'] = ""