本文介绍了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没有输入文件指定的错误
发布评论