The directive below is intended to block access to the thank you page. It appears below the WordPress directives. It does not work as intended in that the page remains accessible and does not display a 403
error
RewriteCond %{THE_REQUEST} ^(.*)?thanks?(/)$ [NC]
RewriteRule ^(.*)$ - [F,L]
When the directive is included as part of the WordPress directives, it works as intended.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} ^(.*)?thanks?(/)$ [NC]
RewriteRule ^(.*)$ - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Why does the first block of directives not work and why does it only work when it's part of the WordPress directives?