Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.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
.htaccess 如何在000webhost中上载我的CodeIgniter项目_.htaccess_Codeigniter - Fatal编程技术网

.htaccess 如何在000webhost中上载我的CodeIgniter项目

.htaccess 如何在000webhost中上载我的CodeIgniter项目,.htaccess,codeigniter,.htaccess,Codeigniter,我创建了一个CodeIgniter项目,它在我的localhost中运行良好,我删除了该项目中的index.php,直接访问默认控制器/localhost/code2/。。。。一切正常 我想要的是,我想上传到000webhost中,我复制了所有ci文件并粘贴到000webhost中的public_html文件夹中,但它显示404错误 //.htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_

我创建了一个CodeIgniter项目,它在我的localhost中运行良好,我删除了该项目中的index.php,直接访问默认控制器/localhost/code2/。。。。一切正常

我想要的是,我想上传到000webhost中,我复制了所有ci文件并粘贴到000webhost中的public_html文件夹中,但它显示404错误

//.htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

重新启动发动机
重写cond%{REQUEST_FILENAME}-f
重写cond%{REQUEST_FILENAME}-d
重写规则^(.*)$index.php?/$1[L]
ErrorDocument 404/index.php

请帮助我解决此问题…

删除.htaccess中解决我问题的所有内容。并确保您的codeigniter文件应位于链接到域的文件夹中

尝试更改此代码:

RewriteRule ^(.*)$ index.php?/$1 [L]
致:

RewriteRule ^(.*)$ ./index.php?/$1 [L]