Hi,
Been banging my head against this all day.
I want to deny access to a few directories, sending either 404 or 403 redirects.
The directories are related to matomo server.
The folders and files I’m trying to deny access to are:
https://stats.mydomain.net/config/config.ini.php
https://stats.mydomain.net/tmp/cache/tracker/matomocache_general.php
https://stats.mydomain.net/tmp/
https://stats.mydomain.net/tmp/empty
https://stats.mydomain.net/lang/en.json
The .htaccess below is doing something as the http->https redirect is working fine.
the server is however still happily allowing access to the directories and files in the list.
Im just a lowly front end dev and I know way too little about any of this stuff. Any help would be greatly appreciated.
RewriteEngine On
order deny,allow
deny from all
allow from mydomain.net
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R]
RewriteRule ^(config|tmp|core|lang).*$ - [F,L,NC]
## I also attempted to target the ini.php file with this line...
## RewriteRule ^ini\.php$ - [F,L,NC]