インストール手順

1.スクリプトをGitHubからダウンロードする >> reachout

2.ファイルを解凍後、env_sample.php をコピーして、ファイル名を env.php に変更

3.env.php をエディタで開いて、定数(サイト名等)を変更

// ReachOut Framework Configuration

// スクリプト情報
define('SCRIPT_VER', '0.2.1');
define('SCRIPT_MODIFIED', '2026/03/11');
// ディレクトリ設定
define('DS', '/');
define('LAYOUT_DIR', 'layout');
define('CSS_DIR', 'css');
define('CACHE_DIR', 'tmp');
// サイト設定
define('SITE_NAME', 'ReachOut - Framework For HTML');
define('TOP_PAGE', 'top.php');
define('LAYOUT_DEFAULT_FILE', 'default.php');
define('HEADER_FILE', 'header.php');
define('CHARSET', 'UTF-8');
define('HTTP', 'https://');
// CSSタグテンプレート
define('CSS_TAG', '');
// キャッシュ設定
define('CACHE_FLG', false);
define('CACHE_LIFE_TIME', 7200);
define('CACHE_STOP', false);
define('NO_CACHE_DIR', array('feed'));
// ファイル設定
define('INDEX_FILES', array('index.html', 'index.php', 'index.htm'));
define('NO_READ_FILES', array('env.php'));

キャッシュを使う場合は、

  • CACHE_FLG を true する
  • CACHE_LIFE_TIME を 1 以上に設定する(7200 なら2時間)

4.サーバにアップロードする(ホスト名:https://www.hogehoge.com と仮定)

5..htaccess を以下のように記述して、index.php と同じ階層に置く

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.[^/\.]+$
RewriteRule .* %{REQUEST_URI}/ [L,R]
RewriteCond %{REQUEST_FILENAME} !^(.*)\.(gif|png|jpg|jpeg|css|js)$ [NC]
RewriteCond $1 !^(index\.php|images|css|js|old_source|robots\.txt)
RewriteRule ^(.*)$ index.php?file=$1 [L]

お好みで変えてみて

サブフォルダに設置する場合は(例.https://www.hogehoge.com/reach_out/)

RewriteEngine on
RewriteBase /reach_out
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.[^/\.]+$
RewriteRule .* %{REQUEST_URI}/ [L,R]
RewriteCond %{REQUEST_FILENAME} !^(.*)\.(gif|png|jpg|jpeg|css|js)$ [NC]
RewriteCond $1 !^(index\.php|images|css|js|old_source|robots\.txt)
RewriteRule ^(.*)$ /reach_out/index.php?file=$1 [L]

6.レイアウトファイルを設置

6-1.フォルダ layout を index.php と同じ階層に作成

6-2.以下のような内容で、default.php というファイルを作成

<!DOCTYPE html>
<html lang="ja">
<head>
    <meta charset="<?= $charset ?>">
    <base href="<?= $pageUrlFull ?>">
    <title><?= $title ?></title>
    <link rel="stylesheet" href="<?= $homeDir ?>/css_default/default.css">
    <?= $css ?>

    <?= $header ?>

</head>
<body>
<?= $contents ?>

</body>
</html>

6-3.フォルダ layout の中にアップロード

7.トップページを作成

7-1.以下のような内容で、top.php というファイルを作成

<!-- config_title:"Home" -->
<!-- config_layout:"default.php" -->
<!-- config_br:"no" -->
これはトップページです。

7-2.index.php と同じ階層にアップロード

以上で終了、以下のような構造になる。

ルートディレクトリ ─┬─ index.php
           │
           ├─ top.php
           │
           ├─ env.php
           │
           └─ layout ─── default.php

https://www.hogehoge.com にブラウザでアクセスし、「これはトップページです。」と表示されれば成功