Google App Engine problem. URL grouping not working

Viewed 27

My app was working fine in php55 using the below app.yaml settings to grouped URLs. E.G. /api/manage, /api/edit, api/user/add should all be forwarded to /api/api.php but stopped working when upgraded to php72.

Fine below the app.yaml conifig for both php55 and php72 for your help.

Configuration for php55

service: default
runtime: php55

    handlers:
    
      - url: /api((/$)|(/[^/]+(/$)?)*)
        script: /api/api.php
        secure: always

Configuration for php72

service: default
runtime: php72

handlers:

  - url: /api/(.*?)/(.*)
    script: /api/api.php
    secure: always

Thanks in advance.

1 Answers

For the 2nd generation runtimes (including PHP 7+) you no longer use the script element to route traffic (documentation). You have to use a language idiomatic web/routing framework (e.g. Flask in Python, a front controller for PHP).

Related