简体   繁体   中英

CodeIgniter routing with GCloud not working

I have set up CI project through LAMP stack of which i have exactly the same problem as this guy CodeIgniter routing in Google App Engine

I been through the post and no solution is found. Ok i will elaborate further. i have CI 3.0 which is set up in gcloud app engine.

app.yaml

runtime: php55
api_version: 1

handlers:
- url: /libs/build/css/*
  static_dir: libs/build/css/

- url: /libs/build/js/*
  static_dir: libs/build/js/

- url: /libs/build/images/*
  static_dir: libs/build/images/

- url: /test
  script: gcloudTest.php

- url: /.*
  script: index.php

routes.php

$route['default_controller'] = "welcome";
$route['404_override'] = '';
$route['login'] = 'api/member/test';

.htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|files|libs|theme|start-file|\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

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

Ok i can access all my controller without specifying route condition like how i did it for $route['login'] = 'api/member/test' as it works on my localhost.

So when i deploy to gcloud i try calling:

  • mysite.com/login => 404 page not found
  • mysite.com/test => working
  • mysite.com/testtest => 404 page not found

/login and /testtest is a valid CI controller while /test is not a controller as it is just there for testing purpose to direct me to another page. So how do i correctly set up CI controller and routing to work with google cloud?

我将我的项目移动到计算引擎,现在正在工作

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM