summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-06-15 23:10:03 +0300
committerAndrew Dolgov <[email protected]>2017-06-15 23:10:03 +0300
commited369290049fe436b6619729bf4bd029ca584159 (patch)
tree6b54fdd6272de26500fe7a391ed59e7b946ff3a8 /index.php
parent05e155454dbf7a797e35f022fa2e0d4729bd83fb (diff)
force redirect to index.php to make sure offline works via service worker request override
Diffstat (limited to 'index.php')
-rw-r--r--index.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/index.php b/index.php
index e33fbd0..217876e 100644
--- a/index.php
+++ b/index.php
@@ -3,6 +3,11 @@
$owner = SQLite3::escapeString($_SERVER["PHP_AUTH_USER"]);
+ if (basename($_SERVER['REQUEST_URI']) != 'index.php') {
+ header('Location: index.php');
+ exit;
+ }
+
if (!$owner) {
header($_SERVER["SERVER_PROTOCOL"]." 401 Unauthorized");
echo "Unauthorized";