This is sort of a follow-up to Is there a way to force apache to return 404 instead of 403? which suggested RedirectMatch
to 404 to accomplish this.
It works perfectly fine for most of anything, however if I request:
http://example.com/.htaccess
I get a 403 and not a 404 if I have (or not) this in my .htaccess
file:
RedirectMatch 404 ^/\.htaccess$
Is there a way to override the default 403 - Forbidden behavior of apache from inside the .htaccess
file itself?
Just after I posted my question, I came to a solution towards the following:
<Files>
rules for .ht
type of files.Works like this:
<Files ~ "^\.ht">
Order Deny,Allow
Allow from all
Satisfy All
Redirect 404 /
</Files>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With