Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess 从codeigniter中的url中删除index.php_.htaccess_Codeigniter_Bluehost - Fatal编程技术网

.htaccess 从codeigniter中的url中删除index.php

.htaccess 从codeigniter中的url中删除index.php,.htaccess,codeigniter,bluehost,.htaccess,Codeigniter,Bluehost,我最近开始使用codeigniter,我将它托管在Bluehost上: 如果我像这样在路径中包括index.php:/codeigniter/index.php/hello,一切正常,但是如果我像这样尝试在没有index.php的情况下访问页面:/codeigniter/hello,我会得到一个500内部服务器错误。我尝试了许多.htaccess选项,但似乎都不起作用 目前,我的.htaccess文件位于此处:/codeigniter/.htaccess,其中包括以下代码: <IfModu

我最近开始使用codeigniter,我将它托管在Bluehost上:

如果我像这样在路径中包括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>
我尝试了所有5个协议选项,但都没有成功


如果您有任何帮助,我们将不胜感激。

您是否尝试过《用户指南》中的帮助


好的,在花了大约3个小时的时间之后,我学到了一个非常重要的教训:Coda不喜欢.htaccess文件。我成功地在服务器上的正确文件夹中获得了一个.htaccess文件,但每次我“发布”对该文件的更改时,.htaccess文件显然从未实际推送到服务器。因此,我的任何更改都没有被执行。所以,我用Dreamweaver来编辑这个文件,现在它工作得很好。这是我现在使用的代码:RewriteCond$1上的RewriteEngine^(index\.php | images | robots\.txt)RewriteRule^(.*)$/codeigniter/index.php/$1[L]
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';