1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 01:39:28 +02:00
ampache/.maintenance.example
Afterster 92872e39f5 Add Ampache information in html header to automatically detect ampache webpage
Allow cross-domain request in default maintenance page example
2015-04-29 13:41:07 +02:00

22 lines
No EOL
651 B
Text

<?php
/**
* To put your Ampache website in maintenance, just rename this file to .maintenance
* This example redirect your visitors to a default maintenance information page hosted in ampache.org
*/
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST");
$domain = $_SERVER['HTTP_HOST'];
if (empty($domain)) {
$domain = $_SERVER['SERVER_NAME'];
}
$scheme = "http";
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$scheme = "https";
}
$fromurl = rawurlencode($scheme . "://" . $domain . $_SERVER[REQUEST_URI]);
header("Location: http://ampache.org/maintenance/?from=" . $fromurl);
exit;
?>