Add support for alternative download domain #3
@ -87,6 +87,13 @@ function handleRequest() {
|
|||||||
|
|
||||||
$url = parse_url($_SERVER['REQUEST_URI']);
|
$url = parse_url($_SERVER['REQUEST_URI']);
|
||||||
|
|
||||||
|
// Fail requests directed at HOST_CDN if they do not match the /download/*/* pattern
|
||||||
|
$pattern = "/^\/download\/[^\/]+\/[^\/]+$/";
|
||||||
|
if (getenv('HOST_CDN') && $_SERVER['HTTP_HOST'] == getenv('HOST_CDN') && !preg_match($pattern, $url['path'])) {
|
||||||
|
header("HTTP/1.0 404 Not Found");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
if ($url['path'] === '/') {
|
if ($url['path'] === '/') {
|
||||||
// Root URL
|
// Root URL
|
||||||
header('Location: /download/daily/');
|
header('Location: /download/daily/');
|
||||||
|
Loading…
Reference in New Issue
Block a user