0

我最近开始使用 codeigniter,并将它托管在 Bluehost 上:http: //dev.fuelingtheweb.com/codeigniter/

如果我在这样的路径中包含 index.php:/codeigniter/index.php/hello,一切正常,但如果我尝试访问没有 index.php 的页面,如下所示:/codeigniter/hello,我得到 500 Internal服务器错误。我尝试了许多 .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 个协议选项,但均未成功。

对此的任何帮助将不胜感激。

4

1 回答 1

2

您是否尝试过用户指南中的那个?

https://www.codeigniter.com/user_guide/general/urls.html

于 2011-10-28T05:27:58.590 回答