如何从codeigniter中的URL中删除index.php? [英] How to remove index.php from url in codeigniter?
本文介绍了如何从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'] = ""
这篇关于如何从codeigniter中的URL中删除index.php?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文