diff --git a/.htaccess b/.htaccess index 8cf3347..daab6ba 100644 --- a/.htaccess +++ b/.htaccess @@ -1,5 +1 @@ AddType application/x-web-app-manifest+json .webapp -RewriteEngine On -RewriteCond %{REQUEST_URI} !=/maintenance.php -RewriteRule ^(.*)\.php$ /maintenance.php [R=301] -RewriteRule ^$ /maintenance.php [R=301] diff --git a/api.php b/api.php index f0b5b37..0834292 100644 --- a/api.php +++ b/api.php @@ -10,6 +10,8 @@ * @license GNU General Public License http://www.gnu.org/licenses/gpl.html * @link http://rudloff.pro * */ +require_once 'config.php'; +require_once 'common.php'; require_once 'download.php'; if (isset($_GET["url"])) { if (isset($_GET['audio'])) { diff --git a/common.php b/common.php new file mode 100644 index 0000000..0ccbac4 --- /dev/null +++ b/common.php @@ -0,0 +1,18 @@ + + * @author Olivier Haquette + * @license GNU General Public License http://www.gnu.org/licenses/gpl.html + * @link http://rudloff.pro + * */ +if (MAINTENANCE) { + header('Location: maintenance.php'); exit; +} +?> diff --git a/config.php b/config.php index 641aa39..a27695f 100644 --- a/config.php +++ b/config.php @@ -15,4 +15,5 @@ define('YOUTUBE_DL', './youtube-dl'); define('PYTHON', '/usr/bin/python'); define('PARAMS', '--no-playlist --no-warnings'); define('CONVERT', true); +define('MAINTENANCE', false); ?> diff --git a/extractors.php b/extractors.php index 4829025..7fdab8f 100644 --- a/extractors.php +++ b/extractors.php @@ -12,7 +12,8 @@ * @license GNU General Public License http://www.gnu.org/licenses/gpl.html * @link http://rudloff.pro * */ - +require_once 'config.php'; +require_once 'common.php'; require 'head.php'; ?> diff --git a/index.php b/index.php index 212342d..24aa3aa 100644 --- a/index.php +++ b/index.php @@ -12,6 +12,8 @@ * @license GNU General Public License http://www.gnu.org/licenses/gpl.html * @link http://rudloff.pro * */ +require_once 'config.php'; +require_once 'common.php'; require 'head.php'; ?> @@ -19,7 +21,6 @@ require 'head.php';
diff --git a/maintenance.php b/maintenance.php index 8d5f08a..0eec8a7 100644 --- a/maintenance.php +++ b/maintenance.php @@ -12,6 +12,10 @@ * @license GNU General Public License http://www.gnu.org/licenses/gpl.html * @link http://rudloff.pro * */ +require_once 'config.php'; +if (!MAINTENANCE) { + header('Location: index.php'); exit; +} require 'head.php'; ?> @@ -25,7 +29,9 @@ require 'head.php';

-
Due to some issues with our server, we have to disable AllTube for a few days. Sorry for the inconvenience.
+
Due to some issues with our server, + we have to disable AllTube for a few days. + Sorry for the inconvenience.