Apache 2.4: how can I allow access to a file through its main directory?

Is it possible to allow a file like http://localhost/some/dir/index.html access ONLY through http://localhost/some/dir (with or without tracking /) by denying access to the file through its direct link? (throw an HTTP 404 error in access)?

I plan to have only this file in this directory.

In addition, I would also like to throw a 404 if the file did not exist in the directory when accessing through that directory.

When searching the Internet, I only found the opposite of this answer, which was only to allow access to the file directly, but not its main directory.

When doing my research, I hypothesized that it could be possible through the use of redirects. Unfortunately, I have no idea where to start in terms of implementing it.