Skip to content
Advertisement

php72 dynamic url routing with front controller via entry point standard not working Google App Engine [GAE]

My dynamic URL is not reading on my website on GAE, cause I want to use the incoming GET to query my database.

As it stands, Php72 does not allowing routing from app.yaml must be from front controller via entry point which the default is publichtml/index.php or index.php.

I changed mine to worker.php. The listing.php URL below is the dynamic that I mean listing/random-dynamic-text-here while index.php and about.php is static pages.

NB: the page index.php and about.php and listing.php is called and displayed on the browser, but i cannot get the content of $_GET[“linkcheck”]; in listing.php. Refer below.

app.yaml

JavaScript

//entry point worker.php

JavaScript

index.php

JavaScript

about.php

JavaScript

Where listing.php below is the file/page where I am expecting $_GET[“linkcheck”];

listing.php

JavaScript

Advertisement

Answer

To achieve this you need to modify two of your files:

worker.php

JavaScript

The difference here is to match regular expression that starts with /listing and send it to the listing Script.

The second modification is on listing to have this line:

<h1><?php $cool = $_GET["linkcheck"]; echo $cool; ?></h1>

replaced by this one:

<h1><?php $cool = $_SERVER['REQUEST_URI']; echo $cool; ?></h1>

I tested it and it works now as espected.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement