0

たとえば、いくつかのドメインがありますhttp://domain.com

http://domain.com/sport -> Folder actually exits

http://domain.com/sport/123/ - > Folder dont exist

http://domain.com/sport/123/hello.html - > file dont exist

したがって、http://domain.com/sport/123/or http://domain.com/sport/123/hello.htmlが訪問されたとき.. not found エラーをスローする代わりに、最初のフォルダー index.php の内容を表示する必要があります。つまり、この例では、の内容を表示する必要があります。http://domain.com/sport/index.php

以下のコードを試しましたが、500内部エラーがスローされます

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/.*$ /$1/index.php [L]
4

1 に答える 1