Requests to .htaccess should return 404 instead of 403

前端 未结 1 1145
有刺的猬
有刺的猬 2020-12-07 02:29

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

相关标签:
1条回答
  • 2020-12-07 02:53

    Just after I posted my question, I came to a solution towards the following:

    • Mimic the default server configuration's <Files> rules for .ht type of files.
    • Allow them.
    • Redirect them to 404.

    Works like this:

    <Files ~ "^\.ht">
      Order Deny,Allow
      Allow from all
      Satisfy All
      Redirect 404 /
    </Files>
    
    0 讨论(0)
提交回复
热议问题