URLに小さなウェブサイトがありますlocalhost/site/。それはと呼ばれる画像を保存するためのファイル.htaccess、ファイル、フォルダを持っていますindex.phpimg
.htaccessファイル
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+) index.php?url=$1 [QSA,L]
上記のコードのように、URLがディレクトリまたはファイルでない場合、すべてのURLlocalhost/siteがリダイレクトされます。index.php
index.phpファイル
<html>
<body>
<img src="img/logo.png"/>
</body>
</html>
問題
localhost/siteまたはに移動すると、正常localhost/site/[any_text]に動作index.phpし、ファイルが正常に読み込まれますimg/logo.png。
しかし、 (実際には終了せず、リクエストのみ)のlocalhost/site/[any_text]/[any_text]サブディレクトリに移動したり、さらに移動したりすると、ロードされませんlocalhost/siteindex.phpimg/logo.png
それで、それはなぜですか?