Codeigniter应用程序无法在应用程序引擎上运行,显示404

时间:2014-01-10 10:59:54

标签: php .htaccess codeigniter google-app-engine

我已将我的网络应用程序上传到应用引擎,它会不断显示404.我已尝试过这些配置。

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

| 'AUTO'默认 - 自动检测 | 'PATH_INFO'使用PATH_INFO | 'QUERY_STRING'使用QUERY_STRING | 'REQUEST_URI'使用REQUEST_URI | 'ORIG_PATH_INFO'使用ORIG_PATH_INFO

我已尝试过所有选项。

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

$route['default_controller'] = "home";
$route['404_override'] = '';

我的.htaccess文件

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
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
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>


<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

我的app.yaml

application: xxxxxxxx
version: x
runtime: php
api_version: 1
threadsafe: false

handlers:
- url: /.*
  script: index.php

1 个答案:

答案 0 :(得分:0)

以下设置适用于使用全新codeigniter v2.1.4设置的WAMP服务器。

<强> CONFIG

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

<强> htaccess的

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteBase /Codeigniter2.1.4/

    #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.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>