Skip to content

Recipes

tkb-github edited this page May 6, 2023 · 29 revisions

Disable mod_rewrite

Having ported the firewall to mod_setenvif, it is possible to also dispense with any remaining rewrite rules. Follow these steps:

  1. Using mod_rewrite for permalink settings is a relic from httpd 2.2. The same effect can now be achieved with mod_dir:
# This still takes precedence over nG-SetEnvIf.
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
FallbackResource /index.php
  1. Rules for access control can switch to using mod_setenvif or Cloudflare’s free-tier WAF.

Wordpress-Specific Recipes

Rate-limit 404s

nG deals in 403s. To fend off excessive 404s, use Wordfence. For best performance, opt out of ‘extended protection’.

Clone this wiki locally