Code:
# block comment spam by denying access to no-referrer requests
RewriteEngine On
RewriteCond %{REQUEST_METHOD} POST
RewriteCond %{REQUEST_URI} .page\.php*
RewriteCond %{HTTP_REFERER} !.*example.com.* [OR]
RewriteCond %{HTTP_USER_AGENT} ^$
RewriteRule ^(.*)$ ^http://the-site-where-you-want-to-send-spammers.com/$ [R=301,L]
I am new to .htaccess and have to ask…
Q1: Can I use this for any page that is posting data?
Q2: If Q1 is YES, my page is one folder deep, ie:comments/page.php
Do I do this:
Code:
RewriteCond %{REQUEST_URI} .comments/page.php\.php*
Or this:
Code:
RewriteCond %{REQUEST_URI} .comments\page.php\.php*
Or this:
Code:
RewriteCond %{REQUEST_URI} .http://www/example.com/comments/page.php\.php*
Or this:
Code:
RewriteCond %{REQUEST_URI} ./var/htdocs/web/comments/page.php\.php*
Edit: I have searched and found nothing that answers my question!
Any help would be great.
Cheers