duanran3115
2012-04-28 08:04
浏览 38
已采纳

Codeigniter没有输入文件指定错误

I have installed CI in subdirecotry www.siteb.com/rexona

My .htaccess inside www.siteb.com/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>

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.

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

4条回答 默认 最新

  • duansen6750 2012-04-28 08:44
    已采纳

    Your uri_protocol needs to be set to something - at least set it to auto.

    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).

    评论
    解决 无用
    打赏 举报
查看更多回答(3条)

相关推荐 更多相似问题