【发布时间】:2014-01-10 10:59:53
【问题描述】:
我已经将我的网络应用上传到应用引擎,它一直显示 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
【问题讨论】:
-
没有 .htaccess 和在你的 url 中使用 index.php 是否可以工作?
-
我没试过。我不想在我的网址中使用 index.php
-
我问只是看看问题出在 htaccess 中,还是在服务器设置中
-
已解决,只是应用程序:xxxxxxxx 版本:x 运行时:php api_version:1 线程安全:错误处理程序:- url:.* 脚本:index.php
-
我试过 url: .* 和 /.* 但没有任何效果。我的 index.php 脚本根本没有运行。它显示为 500 服务器响应。有什么想法吗?
标签: php .htaccess codeigniter google-app-engine