pTi
pTi

Reputation: 357

Google App Engine - Need to clear GAE process written in PHP

I have two questions to clarify

I am new to google app engine. Need support clear some process of doing: 1. First Question: I have create a simple app to test tutorials provided by the google. I need to clarify the way I did was correct.

Following is the way I implement: app.yaml:

application: praveenhellogapp
version: 1
runtime: php
api_version: 1
threadsafe: yes

handlers:
- url: /favicon\.ico
  static_files: favicon.ico
  upload: favicon\.ico

- url: /stylesheets
  static_dir: stylesheets


- url: /(.+\.php)$
  script: \1

- url: /googletutorials/
  script: googletutorials/linkstaticfile.php

- url: .*
  script: linkstopages.php

you can check the output I deploy to the GAE cloud: http://praveenhellogapp.appspot.com/

  1. Second Question

I do not understand the script: \1 concept clear. what is the use of doing script: \1 "url: /(.+.php)$ script: \1"

Upvotes: 1

Views: 73

Answers (1)

Mars
Mars

Reputation: 1412

The order of the handlers matters, so your 3rd rule, i.e. /(.+.php)$ takes precedence over the 4th and 5th. As for the regex syntax, see http://en.wikipedia.org/wiki/Regular_expression for more details. The \1 represents whatever is matched in the URL. In other words, a request to /foo.php will invoke the script foo.php in your app folder.

Upvotes: 1

Related Questions