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

报告相同问题?

悬赏问题

  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持