Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php CodeIgnite未在locahost上加载默认或任何其他控制器_Php_.htaccess_Codeigniter - Fatal编程技术网

Php CodeIgnite未在locahost上加载默认或任何其他控制器

Php CodeIgnite未在locahost上加载默认或任何其他控制器,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,默认控制器(欢迎页面)未加载,也未加载任何其他控制器。除以下所列内容外,我未做任何其他更改: 已将WAMP上的CI版本2.1.4下载并安装到此目录-> http://localhost/ci/我在下面设置配置文件元素之后: $config['base_url'] = 'http://localhost/ci/'; 然后,我将.htaccess fromDeny all设置为: RewriteEngine on RewriteBase /ci/ RewriteCond $1 !^(index\.

默认控制器(欢迎页面)未加载,也未加载任何其他控制器。除以下所列内容外,我未做任何其他更改:

已将WAMP上的CI版本2.1.4下载并安装到此目录->
http://localhost/ci/
我在下面设置配置文件元素之后:

$config['base_url'] = 'http://localhost/ci/';
然后,我将.htaccess from
Deny all
设置为:

RewriteEngine on
RewriteBase /ci/
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
如有任何建议,将不胜感激

谢谢。

试试这个。htaccess:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /ci/index.php/$1 [L]

感谢大家帮助我设置CodeIgniter 2.1.4版。看来我原来下载的软件包有问题。删除目录并再次下载CI文件后,一切正常

无需设置基本url:

$config['base_url'] = ' ';


RewriteEngine on
RewriteCond $1 !^(index.php|images|css|js|robots.txt|favicon.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

您所指的“目录”是一个url。@brett santore我尝试了
$config['base\u url']='/ci/'还是什么都没有。WAMP工作正常吗?你能用回声“hello”显示hello世界页面吗
在WAMP安装根目录的index.php页面上。@brett santone是的,我有多个站点在WAMP上的单独文件夹中运行。我甚至有另一个旧版本的CI应用程序(bambooInvoice)运行时没有问题。不起作用。同样,加载默认索引页(//localhost/ci/index.php)将加载
welcome\u message.php
页面,该页面是
welcome
控制器的视图,如果看到结果,请尝试更改其内容,这样就没有问题了,欢迎消息文件路径为
ci/application/views/welcome\u message.php
。再次感谢您的帮助。但问题不在于.htaccess。如果类型<代码>http://localhost/ci/index.php/welcome/index该模型未加载,Welcome()控制器也未加载。
http://localhost/ci/
就是显示的那个。我甚至尝试过从自动更改为请求URI。还是没什么。谢谢默认页面上说了什么?您能粘贴您在这里看到的第一行吗?
目录访问被禁止。
这是重命名为index.html的默认index.html页面的内容。