首页 文章

从codeigniter中的url中删除index.php

提问于
浏览
0

我最近开始使用codeigniter,我在这里托管了Bluehost:http://dev.fuelingtheweb.com/codeigniter/ .

如果我在这样的路径中包含index.php:/codeigniter/index.php/hello,一切正常,但是如果我尝试访问不带index.php的页面:/ codeigniter / hello,我得到500内部服务器错误 . 我尝试了很多.htaccess选项,但似乎没有任何效果 .

目前,我的.htaccess文件位于此处:/ codeigniter/.htaccess,它包含以下代码:

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /codeigniter/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.+)$ codeigniter/index.php/$1 [NC,L,QSA]
</IfModule>

<IfModule !mod_rewrite.c>
  ErrorDocument 404 index.php
</IfModule>

另外,我的配置文件(/codeigniter/application/config/config.php)包括以下内容:

$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';

我尝试了所有5种协议选项但没有成功 .

任何有关这方面的帮助将不胜感激 .

1 回答

相关问题