Codeigniter – 没有指定input文件

嗨,我是Codeigniter的初学者,我看到一个CI教程,只是想做一件简单的事情。 我下载了configuration文件,并将此文件添加到控制器目录,但不起作用。

<?php class site extends CI_Controller { public function index() { echo "Hello World"; } function dosomething() { echo "Do Something"; } } ?> 

当我尝试访问它使用http://…./index.php/site我得到的输出…“没有input文件指定”….顺便说一下,我命名文件site.php

只需添加 在.htaccess文件中的index.php之后签名:

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

它会工作!

Godaddy托pipe似乎固定在.htaccess ,我自己正在工作

 RewriteRule ^(.*)$ index.php/$1 [L] 

 RewriteRule ^(.*)$ index.php?/$1 [QSA,L] 

我在这里find了这个问题的答案…..问题是托pipe服务器…我感谢所有谁试图….希望这会帮助别人

Godaddy安装提示

RewriteEngine,DirectoryIndex在CodeIgniter应用程序的.htaccess文件中

我只是改变了.htaccess文件的内容,如下面的链接所示。 并尝试刷新页面(这是行不通的,无法find我的控制器的请求)它的工作。

然后,只是因为我怀疑我撤消了我的.htaccess我的public_html文件夹中的原始.htaccess内容所做的更改。 所以现在如下(原来是这样):

 DirectoryIndex index.php RewriteEngine on RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA] 

而且现在也起作用了。

提示:就像之前重写规则尚未在服务器上下文中清楚设置。

我的文件结构如下:

 / |- gheapp | |- application | L- system | |- public_html | |- .htaccess | L- index.php 

而在index.php我已经设置了以下path到系统和应用程序:

 $system_path = '../gheapp/system'; $application_folder = '../gheapp/application'; 

注意:通过这样做,我们的应用程序源代码首先被隐藏。

请,如果你们发现我的答案有任何问题,请评论并重新纠正我!
希望初学者会发现这个答案有帮助。

谢谢!