This article introduces how to restrict access to specific files in .htaccess on Apache servers.
I wanted to display only PHP files and not display txt files. You can restrict access to specific files by specifying the path from the current directory using regular expressions.
RewriteRule ^.*\.txt$ - [F,L]