John Davidson

php - Google App Engine problem. URL grouping not working

0 comments
Message:


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.



My Answer:
It looks like the URL grouping pattern in your app.yaml file for php72 is not matching the URLs as expected.

You can try updating the URL pattern in the php72 configuration to match the URLs in a similar way as the php55 configuration.

Here is an updated configuration for php72 that should work for your case:

yaml
service: default
runtime: php72

handlers:

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


This configuration should group URLs like /api/manage, /api/edit, and /api/user/add and forward them to /api/api.php as expected.

Make sure to deploy the updated configuration to your Google App Engine instance and test if the URL grouping is working correctly now.

Let me know if you need any further assistance.

Rate this post

4 of 5 based on 7184 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us