从codeIgniter路径删除index.php [英] remove index.php from codeIgniter path

查看:98
本文介绍了从codeIgniter路径删除index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在从CodeIgniter的网址中移除index.php时遇到问题。

I have a problem with removing the "index.php" from my URL in CodeIgniter.

尝试将我的.htaccess文件更改为:

I tried as to change my .htaccess file to :

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

我也尝试将 $ config ['index_page'] 更改为 code>并将 $ config ['uri_protocol'] 更改为'REQUEST_URI',但不会工作。

I also tried to change $config['index_page'] to '' and to change $config['uri_protocol'] to 'REQUEST_URI' but it won't work.

我也添加了这些行到 etc / apache2 / apache2.conf

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all

bu它也无效。

推荐答案

尝试这个:

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

您可以在这里找到其他解决方案:如何删除index.php在codeigniter的路径

You'll find other solutions here: How to remove "index.php" in codeigniter's path

这篇关于从codeIgniter路径删除index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆