.htaccess - Apache mod_rewrite | RewriteCond doesn't work -
i own wordpress site, , have ddos attack on /wp-login.php. trying do, restrict access file mod_rewrite, no luck.
more specific, trying do, allow access file, users using keywork google in query string. if keyword not exists, redirect user google web site.
example:
- allow : http://www.my-site.ext/wp-login.php?google
- redirect : http://www.my-site.ext/wp-login.php http://www.google.com
the htaccess using following, seem not works:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{request_file} \/wp\-login\.php rewritecond %{query_string} !google rewriterule (.*) http://www.google.com/ [r=301,l] </ifmodule>
how can rewrite rule, in order allow above functionality work ?
note: have try above rules without first rewritecond check requested file name, , redirection google prerformed normaly, limit redirection wp-login.php
kind regards
replace code with:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewritecond %{query_string} !^google [nc] rewriterule ^wp-login\.php$ http://www.google.com/ [r=301,l,nc] </ifmodule>
make sure test in different browser or clear browser cache.
Comments
Post a Comment