Codeigniter URL需要index.php,而localhost中的一切都很好

时间:2013-12-14 09:39:37

标签: php .htaccess codeigniter url mod-rewrite

我已经在现场设置了数十个CI项目,但之前从未遇到过这个问题。我上传了网站(/ 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>  

在以前的项目中工作得很好。

我在cofig / config.php中做了

$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO'; // tried REQUEST_URI too not working...

我认为这是服务器问题? mod_rewrite也启用了。

0 个答案:

没有答案