Slim4 サブディレクトリ展開メモ
2022/04/22
/var/html/public_html/がドキュメントルートで/var/html/public_html/sub/をアプリケーション実行ディレクトリ- アプリケーション本体は
/var/html/app/にある
みたいな構成ができるか?
public/index.php→sub/index.php(ディレクトリ名変更)require __DIR__ . '/../app/settings.php';のような記述を軒並み書き換えて行けば行けそうな気がしないでもない$app->setBasePath('/sub');とする
/var/html/public_html/sub/.htaccessを次のように記述
# Rewrite URL
RewriteEngine on
# redirect to /index.php
RewriteBase /test
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php [L,QSA]
として行けるか?