Google Apps Engine for PHP7 now requires a "front-controller". These are the URL I need to manage:
- /sitemap.xml
- /app/myPHP ?param1=value ¶m2=value2
my source folder has the following files
- index.php (front controller)
- home.php
- gen_sitemap.php
- myPHP.php
so I coded my front-controller (index.php) as
<?php
switch ($_SERVER['REQUEST_URI']) {
case '/':
require 'home.php';
break;
case '/sitemap.xml':
require 'gen_sitemap.php';
break;
case '/app/myPHP':
require 'myPHP.php';
break;
default:
echo "no page " . time();
break;
}
But it is not parsing correctly the URLs:
https://myProject.appspot.com/ --> home.php ok
https://myProject.appspot.com/?p="hello" --> no page
https://myProject.appspot.com/sitemap.xml --> sitemap.php ok
https://myProject.appspot.com/sitemap.xml?p="h" --> no page
https://myProject.appspot.com/app/myPHP --> myPHP.php ok
https://myProject.appspot.com/app/myPHP?p="h" --> no page
How do I fix this front-controller ? thank you,