Created
December 13, 2011 23:56
-
-
Save k-holy/1474541 to your computer and use it in GitHub Desktop.
PHP5.4ビルトインサーバのルータースクリプト
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 | |
// ポート8080の場合、ショートカットのリンク先 C:\php5.4\php.exe -S 127.0.0.1:8080 built-in-server.php | |
// 作業フォルダにドキュメントルートを入力して起動 | |
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); | |
if (strcmp('/', $path) !== 0) { | |
if (file_exists(realpath(__DIR__ . $path))) { | |
return false; | |
} | |
} | |
require __DIR__ . DIRECTORY_SEPARATOR . 'index.php'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment