没有输入文件中指定 - codeigniter [英] No input file specified - Codeigniter

查看:105
本文介绍了没有输入文件中指定 - codeigniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的codeigniter,uploding我的网站时,默认的CONTROLER /视图显示细腻。然而,当我尝试打开其他网页它提供了以下错误

未指定输入文件。

。什么困扰我的是这工作正常的本地主机。

我已经阅读了这个论坛有关更改htaccess的文件,但我不知道它的htaccess文件来更改以及如何。

请帮助

在此先感谢

解决方案

您更改的.htaccess 这是你的根目录下(如系统,应用程序文件夹),编辑它在任何文本编辑器并保存为的.htaccess

的.htaccess 的示例如下:

 < IfModule mod_rewrite.c>
    RewriteEngine叙述上
    的RewriteBase /

    #Removes用户访问到系统文件夹。
    #Additionally这将允许您创建一个System.php控制器,
    #previously这将是不可能。
    #'系统'可以,如果你已重命名系统文件夹进行更换。
    的RewriteCond%{REQUEST_URI} ^系统。*
    重写规则^(。*)$ /index.php?/$1 [L]

    #当你的应用程序文件夹没有在系统文件夹
    #这个片断prevents用户到应用程序文件夹的访问
    Fabdrol:由#Submitted
    #Rename'应用'为您的应用程序文件夹名称。
    的RewriteCond%{REQUEST_URI} ^应用。*
    重写规则^(。*)$ /index.php?/$1 [L]

    #Checks,查看是否用户正在试图访问一个有效的文件,
    #such作为图像或CSS文档,如果这不是它发送的真实
    #request的index.php
    的RewriteCond%{} REQUEST_FILENAME!-f
    的RewriteCond%{} REQUEST_FILENAME!-d
    重写规则^(。*)$的index.php?/ $ 1 [L]
< / IfModule>

<!IfModule mod_rewrite.c>
    #如果我们没有mod_rewrite的安装,所有404的
    #可以被发送到index.php,一切工作正常。
    的ErrorDocument 404的index.php
< / IfModule>
 

如果你的目标是从您的网址中删除的index.php请找到的config.php 文件的application / config 文件夹和编辑几行如下:

  $配置['BASE_URL'] ='http://yourdomainhere.com.uk.alien.org';


$配置['index_page'] =''; //使这一空白
 

修改

<块引用> .htaccess文件必须在Unix中仅换风格。如果你用记事本或写字板,并上传.htaccess文件中的CR / LF风格是行不通的。

I am new to Codeigniter, when uploding my website the default controler/view displays fine. However when i try to open other pages it gives the following error

"No input file specified."

. What puzzles me is this works fine in localhost.

I have read in this forum about changing htaccess file but i have no clue which htaccess file to change and how.

Kindly help

Thanks in advance

解决方案

You change .htaccess that is in your root directory (where system, application folders are), edit it in any text editor and save it as .htaccess.

Example of .htaccess is as follows

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #When your application folder isn't in the system folder
    #This snippet prevents user access to the application folder
    #Submitted by: Fabdrol
    #Rename 'application' to your applications folder name.
    RewriteCond %{REQUEST_URI} ^application.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    ErrorDocument 404 /index.php
</IfModule>

If you are aiming to remove index.php from your url please find config.php file in application/config folder and edit few lines as follows

$config['base_url'] = 'http://yourdomainhere.com.uk.alien.org';


$config['index_page'] = ''; //make this blank

EDIT

The .htaccess file must be in Unix LF only style. If you use Notepad or Wordpad and upload an .htaccess file in CR/LF style it won't work.

这篇关于没有输入文件中指定 - codeigniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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