router.php 451 B

12345678910111213141516171819
  1. <?php
  2. $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
  3. // Exclude some paths from being rewritten
  4. if (dirname($path) == '/' && pathinfo($path, PATHINFO_EXTENSION) == 'css') {
  5. return false;
  6. }
  7. else {
  8. $file = 'index.php';
  9. // Split into two parts, the ppub and the path within the ppub
  10. $parts = explode("/", $path, 3);
  11. $_GET['ppub'] = $parts[1];
  12. $_GET['asset'] = $parts[2];
  13. }
  14. $_SERVER['SCRIPT_NAME'] = '/' . $file;
  15. require $file;