12345678910111213141516171819202122 |
- <?php
- $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
- // Exclude some paths from being rewritten
- if (str_starts_with(dirname($path), "/themes") || (dirname($path) == '/' && (pathinfo($path, PATHINFO_EXTENSION) == 'css' || pathinfo($path, PATHINFO_EXTENSION) == 'js'))) {
- return false;
- }
- else if ($_SERVER["REQUEST_METHOD"] === "POST" && $_SERVER["CONTENT_TYPE"] === "application/pprf") {
- $file = 'pprf.php';
- }
- else {
- $file = 'index.php';
- // Split into two parts, the ppub and the path within the ppub
- $parts = explode("/", $path, 3);
- $_GET['ppub'] = $parts[1];
- $_GET['asset'] = $parts[2];
- }
- $_SERVER['SCRIPT_NAME'] = '/' . $file;
- require $file;
|