1
すべての.phpスクリプトをhtaccessを使ってindex.phpにリダイレクトします。/assets /フォルダー内にあるスクリプトは除きます。例えばhtAccess資産フォルダ以外のすべての.phpをリダイレクト
:
/test.php -> /index.php
/folder/test.php -> /index.php
/assets/test.php -> /assets/test.php
/assets/folder/folder/test.php -> /assets/folder/folder/test.php
これが私の現在のhtaccessファイルです:
RewriteEngine on
RewriteCond %{REQUEST_URI} !(\.png|\.jpg|\.gif|\.jpeg|\.bmp|\.css|\.js|\.woff|\.woff2|\.map|\.ico|\.map)$
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]