deny direct access to a folder and file by htaccess
snippet in htaccess

deny direct access to a folder and file by htaccess

user9440

deny from all

deny direct access to a folder and file by htaccess

user2961

<Files ~ "^.*">
  Deny from all
</Files>

<Files ~ "^index\.php|css|js|.*\.png|.*\.jpg|.*\.gif">
  Allow from all
</Files>

deny direct access to a folder and file by htaccess

user7093

RewriteRule ^(includes/|submit\.php) - [F,L,NC]

deny direct access to a folder and file by htaccess

user9918

RedirectMatch 403 ^/folder/file.php$