Go back to index
| ">Refresh
Pretty urls
Pretty urls
$_SERVER
$v) {
if (is_array($v)) {
continue;
}
if (strpos($v, "pretty-urls.php") !== false
|| strpos($v, "company") !== false
|| strpos($v, "xyz") !== false
|| strpos($v, "foo") !== false
|| strpos($v, "bar") !== false
|| $k == "REQUEST_METHOD"
|| $k == "REQUEST_URI") {
$url_vars[$k] = $v;
}
}
print "";
print_r($url_vars);
print "
";
}
print_url_variables();
?>
Pretty urls can be handled by setting ["web_server"]["404_handler"]
option in settings.json file. This is how it works:
- Set 404_handler to "/pretty-urls.php"
- Load url like "/company/5"
- Mongoose web server does not find such file "/company/5",
and instead makes a request to "/pretty-urls.php/company/5".
- To know the pretty url that was accessed check
the PATH_INFO or REQUEST_URI environment variables.
Test pretty urls:
Test POST request to
POST data
Other tests (these urls do not require 404_handler to be set):