.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule ((?s).*) public/$1 [L]
</IfModule>
-----------------------------------------------------------------
/public/.htaccess
AddDefaultCharset UTF-8
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L]
</IfModule>
-----------------------------------------------------------------
.htrouter.php
$uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
if ($uri !== '/' && file_exists(__DIR__ . '/public' . $uri)) {
return false;
}
$_GET['_url'] = $_SERVER['REQUEST_URI'];
require_once __DIR__ . '/public/index.php';
'저장용 > linux' 카테고리의 다른 글
[linux] Headers and client library minor version mismatch. (0) | 2018.10.19 |
---|---|
[linux] CentOS 에서 iptables 설정 하기. (0) | 2017.06.02 |
[linux] rsync 원격서버에 있는 파일 가져오기. (0) | 2015.03.19 |