My app.yaml looks like:
application: skilled-mark-657
version: 1
runtime: php
api_version: 1
handlers:
- url: /scripts
static_dir: scripts
- url: /admin?dir=(.*)
script: admin.php
- url: /admin
script: admin.php
- url: /admin/delete
script: delete.php
Then admin.php looks like:
<?php
$path = str_replace("/admin", '', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
$_GET['dir'] = $path;
var_dump($_GET);
When i go to /admin?dir=someFolder I'm redirected back to /admin. I'm trying to have urls that are either just /admin or follows the pattern /admin?dir=(.*). So that way in my admin.php I can properly look in the correct directory based on the given query param. How can I achieve this correctly?
I'm not quite sure I'm fully following what you're saying, so please feel free to go ahead and give more details.
If my understand is correct, and that you want all of your /admin URLs to be handled by admin.php, and basically be able to get value of 'dir' that's being passed, you could try this:
App.yaml
Admin.php