Created
December 1, 2010 16:31
-
-
Save chobie/723740 to your computer and use it in GitHub Desktop.
This file contains 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
... .htaccess | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteRule ^(.*\.html)$ file.php?target=$1 [QSA,L] | |
#敢えてファイルが存在するときで、末尾に.htmlが付くファイルの場合のみリライトさせる | |
</IfModule> | |
... file.php | |
<?php | |
//エラーチェック手抜きです>< | |
if(!isset($_REQUEST['target']){ | |
header(404); | |
exit; | |
} | |
ob_start(); | |
include $_REQUEST['target']; | |
$data = ob_get_clean(); | |
// output filtering... | |
echo $data; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment