.htaccess rewrite rule delete everything after RK = 0 / RS =

I have a website that has many requests for pages that do not exist.

All requests are based on an existing page, but have RK=0/RS= plus a random string of characters at the end.

For example, the query:

 www.domain.com/folder/article/RK=0/RS=M9j32OWsFAC_u8I6a0xOMjYKU_Q- 

but the page www.domain.com/folder/article exists.

I would like to use htaccess to say:

if RK=0/RS= exists, delete it and everything after

but could not get it to work.

All htaccess rules talk about deleting query strings, but I guess because it doesn't ? This is not a request.

Can someone help me figure out how to do this?

+8
regex apache .htaccess mod-rewrite
source share
2 answers

This rule can be used in the root .htaccess file:

 RewriteEngine On RewriteRule ^(folder/article/)RK=0/RS= /$1 [L,NC,R=301] 
+3
source share

Someone found where this mess came from. http://xenforo.com/community/threads/server-logs-with-rk-0-rs-2-i-now-know-what-these-are.73853/

This doesn't seem to be malicious in fact, something broke with Yahoo rewrites that create URLs that point to pages that don't exist. The demo described on xenforo replicates it and the URL pattern that Yahoo produces:

 http://r.search.yahoo.com/_ylt=A0SO810GVXBTMyYAHoxLBQx./RV=2/RE=1399899526/RO=10/RU=http%3a%2f%2fkidshealth.org%2fkid%2fhtbw%2f/RK=0/RS=y2aW.Onf1Hs6RISRJ9Hye6gXvow- 

Of course, this is similar to RV =, RE =, RU =, RK =, RS = values โ€‹โ€‹of one family. It's just that somewhere, arg concatenation is screwed onto their side.

+4
source share

All Articles