Forum Moderators: phranque
RewriteCond %{HTTP_REFERER} !^http://(www\.)myownsite.com/.*$ [NC]
...add to the most likely entry page a small and invisible link ( display:none ? ) to a dummy page such that when a bot follows the link its IP address is stored and site access is denied.
URL request (file or folder obviously doesn't exist but the request returns the above URL):
www.myownsite.com/page.html/string
AcceptPathInfo Off
I assume the reason for the parentheses on "www" are to make the subdomain optional? In which case you need a "?" suffix, ie. (www\.)?
RewriteCond %{HTTP_REFERER} ^http://example\.com www.myownsite.com/page.html/string
RewriteRule \.html. - [F] RewriteCond %{REQUEST_URI} (.+\.html)
RewriteRule \.html. http://www.example.com/%1 [R=301,L] You could probably lose the NC flag as well? In most legitimate cases this is always going to be lowercase. (?)
It's a good practice to only include file types that your site (s) contain. No since in wasting server time/CPU to check for something that isn't there.
On non- Wordpress sites I call the target file "wp-login.php" to kill two birds with one click - it catches scrapers ignoring robots.txt and hackers trying to log in to a non-existent wp install.
But I'm trying to block strings that could be either upper or lower case. Forgive me; there's something here I'm not understanding.