wordpress - mod_rewrite Blocking user agent post requests with empty referral strings -



wordpress - mod_rewrite Blocking user agent post requests with empty referral strings -

my wordpress website getting inundated post requests. nearing 200,000 requests day.

here sample of apache access log:

218.75.48.179 - - [24/jun/2014:13:16:13 -0700] "post / http/1.1" 403 - "-" "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1)" 195.226.235.101 - - [24/jun/2014:13:16:13 -0700] "post / http/1.1" 403 - "-" "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1)" 186.116.184.32 - - [24/jun/2014:13:16:14 -0700] "post / http/1.1" 403 - "-" "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1)" 95.43.217.197 - - [24/jun/2014:13:16:14 -0700] "post / http/1.1" 403 - "-" "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1)" 110.168.188.207 - - [24/jun/2014:13:16:14 -0700] "post / http/1.1" 403 - "-" "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1)" 113.161.194.225 - - [24/jun/2014:13:16:14 -0700] "post / http/1.1" 403 - "-" "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1)" 80.9.11.226 - - [24/jun/2014:13:16:14 -0700] "post / http/1.1" 403 - "-" "mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1)"

i'm trying block these requests mod_rewrite while still allowing wordpress mod_rewrite code work. have far isn't blocking requests. can take , give me suggestions?

here .htaccess file:

errordocument 403 "403 error" <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{request_method} post rewritecond %{http_referer} ^$ rewritecond %{http_user_agent} "^mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1)" rewriterule ^.* 403 [f,l] rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule>

i denying traffic other ip address.

you shouldn't utilize %{http_referer} this. need utilize %{remote_addr} this:

rewritecond %{request_method} post rewritecond %{remote_addr} !=11.22.33.44 rewritecond %{http_user_agent} "^mozilla/4.0 (compatible; msie 6.0; windows nt 5.1; sv1)" rewriterule ^.* 403 [f,l]

change 11.22.33.44 actual ip address.

wordpress .htaccess mod-rewrite post

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -