Created
November 3, 2017 10:52
-
-
Save iksi/466baefca807c08921218eddb29a12ba to your computer and use it in GitHub Desktop.
server.php for kirby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// removes querystrings | |
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
if (file_exists($_SERVER['DOCUMENT_ROOT'] . $path)) return false; | |
// what the .htaccess would normally do | |
if (preg_match('/^\/panel\/(.*)/', $path)) { | |
$_SERVER['SCRIPT_NAME'] = DIRECTORY_SEPARATOR . 'panel' . DIRECTORY_SEPARATOR . 'index.php'; | |
} else { | |
$_SERVER['SCRIPT_NAME'] = DIRECTORY_SEPARATOR . 'index.php'; | |
} | |
require_once $_SERVER['DOCUMENT_ROOT'] . $_SERVER['SCRIPT_NAME']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment