WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following rules set in my .htaccess file to block spam. It works by not allowing anyone to login, register, or make a comment unless the conditions are met. It works, but I would like to add Contact Form 7 (version 3.2) in there somehow.

RewriteCond %{HTTP_COOKIE} !^PHPSESSID=\w+ [OR]
RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?example\.com/ [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule ^wp-(comments-post|login|register)\.php http://example\.com [R=301,L,NS]

I've tried using wp-contact-form-7.php and submit.php. I've also tried using the uri /contact-us/ where the contact form is located and none work.

share|improve this question

closed as off-topic by birgire, Pieter Goosen, Mark Kaplun, Johannes Pille, gmazzap Sep 15 '14 at 23:08

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – birgire, Pieter Goosen, Mark Kaplun, Johannes Pille, gmazzap
If this question can be reworded to fit the rules in the help center, please edit the question.