PHP   发布时间:2022-04-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了php – Codeigniter没有输入文件指定错误大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我在子网站www.siteb.com/rexona中安装了CI

我的.htaccess在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>

在config.php中:

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

每当我尝试访问控制器时,我都没有指定输入文件.但它确实加载了默认控制器,但我也无法访问默认控制器中的任何方法.

有什么想法吗?
谢谢.

解决方法

您的uri_protocol需要设置为某些内容 – 至少将其设置为auto.

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

大佬总结

以上是大佬教程为你收集整理的php – Codeigniter没有输入文件指定错误全部内容,希望文章能够帮你解决php – Codeigniter没有输入文件指定错误所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: