I am using this GitHub page: https://github.com/Athlon1600/php-proxy-app and as it's supposed to, when I go to development.stech.software it loads up index.php
.
When I choose a link, it makes it a query string like this development.stech.software/index.php?q=y6ml06abkWPdp6pnn6PVl6TLlMSkpmdvzdzUj6WZbqbWoQ (where the random characters is the query).
How do I adjust the index.php
file, so that when I go to a URL, it loads it on /index.php/query/y6ml06abkWPdp6pnn6PVl6TLlMSkpmdvzdzUj6WZbqbWoQ
or something similar.
I tried this, but it wouldn't work (it reported 500), I found it from URL rewriting with PHP
$path = ltrim($_SERVER['REQUEST_URI'], '/'); // Trim leading slash(es)
$elements = explode('/', $path); // Split path on slashes
if(empty($elements[0])) { // No path elements means home
ShowHomepage();
} else switch(array_shift($elements)) // Pop off first item and switch
{
case 'index':
ShowPicture($elements); // passes rest of parameters to internal function
break;
case 'more':
...
default:
header('HTTP/1.1 404 Not Found');
Show404Error();
}
I also added this to .htaccess FallbackResource htdocs/index.php