どうせ.htaccessでやるんであればRewriteで/
以外を403で返してやるのでダメですか?
htaccess
1RewriteEngine On
2RewriteCond %{REQUEST_URI} !^/$
3RewriteRule .* - [R=403]
検証
console
1root@localhsot:/var/www/html# cat .htaccess
2RewriteEngine On
3RewriteCond %{REQUEST_URI} !^/$
4RewriteRule .* - [R=403]
5
6root@localhsot:/var/www/html# telnet localhost 80
7Trying 127.0.0.1...
8Connected to localhost.
9Escape character is '^]'.
10HEAD /index.php HTTP/1.1
11Host: localhost
12
13HTTP/1.1 403 Forbidden
14Date: Wed, 29 Jan 2020 05:12:27 GMT
15Server: Apache/2.4.29 (Ubuntu)
16Content-Type: text/html; charset=iso-8859-1
17
18Connection closed by foreign host.
19root@localhsot:/var/www/html# telnet localhost 80
20Trying 127.0.0.1...
21Connected to localhost.
22Escape character is '^]'.
23HEAD / HTTP/1.1
24Host: localhost
25
26HTTP/1.1 200 OK
27Date: Wed, 29 Jan 2020 05:12:46 GMT
28Server: Apache/2.4.29 (Ubuntu)
29Last-Modified: Mon, 02 Dec 2019 04:42:40 GMT
30ETag: "12-598b135a45b04"
31Accept-Ranges: bytes
32Content-Length: 18
33Content-Type: text/html
34
35Connection closed by foreign host.
36
37root@localhsot:/var/www/html# telnet localhost 80
38Trying 127.0.0.1...
39Connected to localhost.
40Escape character is '^]'.
41HEAD /img/test.jpg HTTP/1.1
42Host: localhost
43
44HTTP/1.1 403 Forbidden
45Date: Wed, 29 Jan 2020 05:13:53 GMT
46Server: Apache/2.4.29 (Ubuntu)
47Content-Type: text/html; charset=iso-8859-1
48
49Connection closed by foreign host.
50root@localhsot:/var/www/html#
51
52
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。