Local app.yaml file gives different results to remote file

58 views
Skip to first unread message

Paul Canning

unread,
Mar 17, 2015, 6:22:03 AM3/17/15
to google-a...@googlegroups.com
In my CodeIgniter application, I have set a handler in the app.yaml file for the following:

handlers:
- url: /task.php
  script: task.php

This file is in the root directory.

In a typical LAMP/WAMP environment, a .htaccess file would be used to allow access, as typically you are only allowed to access the index.php file (that's how CI works).

So, there is no .htaccess in GAE, only app.yaml (and dispatch.yaml etc)

Locally, I can access http://localhost:8080/test.php, remotely, I get the CI 404 page.

Why would there be a difference?

(I understand this is most likely an issue with how CI works, but the fact that the yaml file gives different results must be something to do with GAE?)

Vinny P

unread,
Mar 18, 2015, 2:06:15 AM3/18/15
to google-a...@googlegroups.com
On Tue, Mar 17, 2015 at 5:22 AM, Paul Canning <pa...@drawandcode.com> wrote:
handlers:
- url: /task.php
  script: task.php

Locally, I can access http://localhost:8080/test.php, remotely, I get the CI 404 page.

Why would there be a difference?



Well, first of all I want to point out that your handler is handling task.php, while your test url is calling for test.php, so it's probably worthwhile to double-check that you're attempting to access the right page. 

If you're still having problems, is that handler instruction the first handler command in app.yaml, or are there other handlers previous to it? If there are other handlers present, try moving your task.php handler to the top. Can you post your entire app.yaml and a picture of your directory structure? If you can't share your directory structure for confidentiality reasons, you can create a small test case that replicates the issue and post that.

 
 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

Paul Canning

unread,
Mar 18, 2015, 6:44:11 AM3/18/15
to google-a...@googlegroups.com
Ah, typo in the question, I was trying to access task.php in both environments!

For some reason, it is working now, and to answer your other question, it was beneath some static file handlers and above the handler for the index.php page.

Vinny P

unread,
Mar 19, 2015, 1:16:05 AM3/19/15
to google-a...@googlegroups.com
On Wed, Mar 18, 2015 at 5:44 AM, Paul Canning <pa...@drawandcode.com> wrote:
Ah, typo in the question, I was trying to access task.php in both environments!

For some reason, it is working now, and to answer your other question, it was beneath some static file handlers and above the handler for the index.php page.


Good to hear! It's always nice when applications seem to fix themselves :-).
Reply all
Reply to author
Forward
0 new messages