From ccc52bd8273e51f55e47ed4f26a8f051af34f36b Mon Sep 17 00:00:00 2001 From: Abdulrahman Date: Mon, 25 Feb 2019 19:55:13 +0300 Subject: [PATCH] move rewrite rules to its own file. --- htaccess.txt | 29 +++++++---------------------- serve.php | 6 +++++- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/htaccess.txt b/htaccess.txt index 62c598e..27ffc4a 100644 --- a/htaccess.txt +++ b/htaccess.txt @@ -1,25 +1,10 @@ #start Kleeja rules -RewriteEngine on -#RewriteBase / -RewriteRule ^index.html$ index.php -RewriteRule ^download([0-9]*).html$ do.php?id=$1 -RewriteRule ^downloadf-(.*)-([a-zA-Z0-9_-]*).html$ do.php?filename=$1&x=$2 -RewriteRule ^down-([0-9]*).html$ do.php?down=$1 -RewriteRule ^downf-(.*)-([a-zA-Z0-9_-]*).html$ do.php?downf=$1&x=$2 -RewriteRule ^downex-([0-9]*).html$ do.php?down=$1 -RewriteRule ^downexf-(.*)-([a-zA-Z0-9_-]*).html$ do.php?downexf=$1&x=$2 -RewriteRule ^thumb([0-9]*).html$ do.php?thmb=$1 -RewriteRule ^imagef-(.*)-([a-zA-Z0-9_-]*).html$ do.php?imgf=$1&x=$2 -RewriteRule ^thumbf-(.*)-([a-zA-Z0-9_-]*).html$ do.php?thmbf=$1&x=$2 -RewriteRule ^image([0-9]*).html$ do.php?img=$1 -RewriteRule ^del([a-zA-Z0-9_-]*).html$ go.php?go=del&cd=$1 -RewriteRule ^(call|guide|rules|stats|report).html$ go.php?go=$1 -RewriteRule ^report[_-]([0-9]*).html$ go.php?go=report&id=$1 -RewriteRule ^(filecp|profile|fileuser|register|login|logout).html$ ucp.php?go=$1 -RewriteRule ^fileuser[_-]([0-9]+).html$ ucp.php?go=fileuser&id=$1 -RewriteRule ^fileuser[_-]([0-9]+)-([0-9]+).html$ ucp.php?go=fileuser&id=$1&page=$2 -#for future plugins -RewriteRule ^go-(.*).html$ go.php?go=$1 + RewriteEngine On + RewriteBase / + RewriteRule ^index\.php$ - [L] + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule . /serve.php [L] -#end Kleeja rules +#end Kleeja rules \ No newline at end of file diff --git a/serve.php b/serve.php index 4d41164..d2116b8 100755 --- a/serve.php +++ b/serve.php @@ -76,4 +76,8 @@ foreach($rules as $rule_regex => $rule_result) include $rule_result['file']; exit; } -} \ No newline at end of file +} + +#fallback +define('SERVE_FALLBACK', true); +include 'go.php'; \ No newline at end of file