Codeigniter没有输入文件指定的错误

编程入门 行业动态 更新时间:2024-10-23 06:32:58
本文介绍了Codeigniter没有输入文件指定的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在子目录中安装了CI。www.siteb/rexona

I have installed CI in subdirecotry www.siteb/rexona

我的.htaccess在www.siteb/rexona内:

My .htaccess inside www.siteb/rexona :

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /rexona #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] #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 #This last condition enables access to the images and css folders, and the robots.txt file #Submitted by Michael Radlmaier (mradlmaier) RewriteCond $1 !^(index\.php|images|robots\.txt|css) RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> <IfModule !mod_rewrite.c> ErrorDocument 404 /index.php </IfModule>

在config.php中:

In config.php:

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

每当我尝试访问控制器时,我会获得没有指定输入文件。但是它加载默认控制器,但我不能访问任何方法在默认控制器。

Whenever I try access controllers I get No input file specified. However it does load default controller, but I cant access any methods in default controller either.

任何想法? 感谢。

Any thoughts? Thanks.

推荐答案

您需要设置您的 uri_protocol

您得到的错误是因为PHP以CGI运行,这意味着您需要将URL重写传递给 index.php?/ $ 1 (注意问号)。

The error you are getting is because PHP runs as CGI which means you need to pass the URL rewrite to index.php?/$1 instead (note the question mark).

更多推荐

Codeigniter没有输入文件指定的错误

本文发布于:2023-10-31 15:45:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546543.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   文件   Codeigniter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!