これは私の現在のhtaccessで、mod_rewriteを使用しています
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !^/?admin/.+$ index.php [L]
RewriteRule ^admin/(.*)$ admin/index.php [L]
管理リクエストを に書き直しadmin/index.php
、他のリクエストをに書き直す必要があります/index.php。
例:
localhost/exampleto /index.php
localhost/foo/barto /index.php
localhost/admin/login/to admin/index.php
localhost/admin/pages/toadmin/index.php
上記のルールは正常に機能しますが、CSS スタイルや JavaScript にも適用されます。つまりadmin/js/jquery.js、too に書き換えadmin/index.phpます (ファイル パスが存在します)。私は何が欠けていますか?