Level 51
Would it not make more sense to have an allow rule for the things you want to allow?
<FilesMatch "sitemap.*\.txt">
Require all granted
</FilesMatch>
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello How to prevent access to txt files except if this file is started by sitemap(.*).txt or by robots.txt
something like :
<FilesMatch "(?i)((\.tpl|.blade|\.ini|\.log|(?<!robots)\.txt))">
Require all denied
but it accepts only robots.txt, and I want to add also txt files with prefix sitemap
thanks
Please or to participate in this conversation.