Forum Moderators: phranque
RewriteCond %{THE_REQUEST} \?(.*)@(.*)?\ HTTP [NC]
RewriteRule .? http://www.mydomain/forbidden.php? [R=302,L] RewriteCond %{THE_REQUEST} \?(.*)@(.*)?\ HTTP [NC]
RewriteRule .? http://www.mydomaind/forbidden.php? [R=302,L] RewriteCond %{THE_REQUEST} ^(GET|POST) /.*?(s|search)=(.+) HTTP/ [NC]
RewriteRule .* /search/%3/? [R=302,L,NE]
RewriteCond %{THE_REQUEST} ^(GET) \?(.*)@(.*)?\ HTTP [NC]
RewriteRule .? http://www.mydomain/forbidden.php? [R=302,L] RewriteCond %{THE_REQUEST} @ RewriteCond %{QUERY_STRING} @ RewriteCond %{THE_REQUEST} \?(.*)@(.*)?\ HTTP [NC]
RewriteRule .? http://www.mydomain/forbidden.php? [R=302,L] RewriteCond %{THE_REQUEST} ^GET\ ?(.*)@(.*)?\ HTTP [NC]
RewriteRule .? http://www.mydomain/not-allowed.php? [R=302,L] RewriteCond %{THE_REQUEST} \?(.*)@(.*)?\ HTTP [NC]
RewriteRule .? http://www.mydomain/not-allowed.php? [R=302,L] [edited by: dolcevita at 12:33 am (utc) on Feb 12, 2015]
RewriteCond %{THE_REQUEST} \?(.*)@(.*)?\ HTTP [NC]
RewriteRule .? http://www.mydomain/forbidden.php? [R=302,L] RewriteCond %{THE_REQUEST} ^GET\ ?(.*)@(.*)?\ HTTP [NC]
RewriteRule .? http://www.mydomain/stop.php? [R=302,L] RewriteCond %{THE_REQUEST} \?(.*)@(.*)?\ HTTP [NC]
RewriteRule .? http://www.mydomain/not-allowed.php? [R=302,L] But i have already blocked it
But how then Google still got email in GET request?
RewriteCond %{THE_REQUEST}@
RewriteRule (^|/|html)$ - [F] RewriteRule not-allowed\.php - [L]
But i have already blocked it
No. You haven't. You have issued a temporary redirect to "forbidden.php" presumably your custom 403 page. A human will probably not know the difference, because they'll see the page with their eyeballs. But to a robot-- including search engines-- there is a huge difference.
The one thing you have got right is the ? at the end of the rule target. That gets rid of the query string in any redirect.
:: uneasily expecting the worst ::
Does your htaccess have any ErrorDocument directives?
ErrorDocument 403 default But how then Google still got email in GET request?
I don't understand exactly what you are saying here. What did google get-- and why were they even trying? I've never seen the googlebot asking for anything unkosher. Silly, yes. Trayf, no.
Url sample: http://www.mydomain/whatever.php?whatever=redacted@example.com
Record sample: GET /pagead/ads?client=ca-pub-*****myid******2&output=html&h=280&slotname=3277054996&adk=3441799868&w=336&lmt=1423334957&flash=16.0.0&url=http%3A%2F%2Fwww.mydomain%2whatever.php%3Fwhatever%3Dredacted@example.com
&dt=1423334957786&bpp=4&bdt=126&shv=r20150203&cbv=r20141212&saldr=sa&prev_slotnames=3335930592&correlator=5132476212332&frm=20&ga_vid=*&ga_sid=*&ga_hid=*&ga_fc=0&u_tz=-300&u_his=11&u_java=0&u_h=768&
u_w=1366&u_ah=728&u_aw=1366&u_cd=24&u_nplug=6&u_nmime=14&dff=trebuchet%20ms&dfs=13&adx=272&ady=207&biw=1349&bih=655&eid=317150304&oid=3
&ref=http%3A%2F%2Fwww.mydomain.org%2Fwhatever.php%3Fip%3Dwhateverever.net.&rx=0&eae=0&fc=24&brdim=%2C%2C-8%2C-8%2C1366%2C0%2C1382%&vis=1&rsz=0%7C0%7C%7C&abl=CS&ppjl=f&fu=0&bc=1&ifi=2&xpc=tzTzMuLIXX&p=http%3A//www.mydomain.org&dtd=234 HTTP/1.1 I would make the rule something like this (replacing 'html' with whatever you really use for your page URLs):
RewriteCond %{THE_REQUEST}@
RewriteRule (^|/|html)$ - [F]
Group it together with any other RewriteRules that lead to the [F] flag.
To prevent infinite loops, make sure you also have this rule if you haven't already got it, again replacing "not-allowed.php" with the actual name of your 403 page:
RewriteRule not-allowed\.php - [L]
It goes before any rules with [F] flag.
RewriteRule not-allowed\.php - [L]
RewriteCond %{THE_REQUEST}@
RewriteRule (^|/|php)$ - [F] RewriteCond %{THE_REQUEST}@
RewriteRule (^|/|php)$ - [F] RewriteCond %{THE_REQUEST}@ [NC]
RewriteRule (^|/|php)$ - [F]
RewriteCond %{THE_REQUEST} ^.*(\\r|\\n|%0A|%0D|@|%3D|%40).*
RewriteRule .* - [F]
Url sample: http://www.mydomain/whatever.php?whatever=redacted@example.com
Record sample: GET /pagead/ads?client=ca-pub-*****myid******2&output=html&h=280&slotname=3277054996&adk=3441799868&w=336&lmt=1423334957&flash=16.0.0&url=http%3A%2F%2Fwww.mydomain%2whatever.php%3Fwhatever%3Dredacted@example.com
&dt=1423334957786&bpp=4&bdt=126&shv=r20150203&cbv=r20141212&saldr=sa&prev_slotnames=3335930592&correlator=5132476212332&frm=20&ga_vid=*&ga_sid=*&ga_hid=*&ga_fc=0&u_tz=-300&u_his=11&u_java=0&u_h=768&
u_w=1366&u_ah=728&u_aw=1366&u_cd=24&u_nplug=6&u_nmime=14&dff=trebuchet%20ms&dfs=13&adx=272&ady=207&biw=1349&bih=655&eid=317150304&oid=3
&ref=http%3A%2F%2Fwww.mydomain.org%2Fwhatever.php%3Fip%3Dwhateverever.net.&rx=0&eae=0&fc=24&brdim=%2C%2C-8%2C-8%2C1366%2C0%2C1382%&vis=1&rsz=0%7C0%7C%7C&abl=CS&ppjl=f&fu=0&bc=1&ifi=2&xpc=tzTzMuLIXX&p=http%3A//www.mydomain.org&dtd=234 HTTP/1.1 You have right
RewriteCond %{THE_REQUEST} ^.*(\\r|\\n|%0A|%0D|@|%3D|%40).*