Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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
Codeigniter URL在live中需要index.php,而在localhost中一切正常_Php_.htaccess_Codeigniter_Url_Mod Rewrite - Fatal编程技术网

Codeigniter URL在live中需要index.php,而在localhost中一切正常

Codeigniter URL在live中需要index.php,而在localhost中一切正常,php,.htaccess,codeigniter,url,mod-rewrite,Php,.htaccess,Codeigniter,Url,Mod Rewrite,我已经在live中设置了数十个CI项目,但以前从未遇到过此问题。我在live(/demo)中上传了该网站,但当我访问“www.example.com/demo”时,我得到的是一个空白屏幕。错误日志中没有错误 毫无疑问,我使用的.htaccess对我上传的所有项目都是一样的 下面是它的写法: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /demo/ #Removes access to the system folder

我已经在live中设置了数十个CI项目,但以前从未遇到过此问题。我在live(/demo)中上传了该网站,但当我访问“www.example.com/demo”时,我得到的是一个空白屏幕。错误日志中没有错误

毫无疑问,我使用的.htaccess对我上传的所有项目都是一样的

下面是它的写法:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /demo/

#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]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
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
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.

ErrorDocument 404 /index.php
</IfModule>  

我认为这是服务器问题?mod_重写也已启用

你的实时服务器是windows吗?@kumar_v:不是。。它的linux..您是否尝试过在
$config['uri\u protocol']='AUTO'中使用
query\u string
?是。。我已经在我的问题中提到过。。不工作:(我说添加查询字符串,比如$config['uri\u protocol']='query\u string';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO'; // tried REQUEST_URI too not working...