Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-05-31 12:24:15

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,032
Website GitHub Mastodon Twitter

forbid access to a particular query via htaccess

Yesterday I got over 4000 hits for /?rss=1&ru which it does not exist. The hits are still coming from various IPs. Could someone suggest an htaccess rule to forbid access to the particular url?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2017-05-31 13:32:33

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: forbid access to a particular query via htaccess

According to this answer on SO, you could do something like this:

RewriteCond %{THE_REQUEST} \s/+[^?]*\?rss=1&ru
    RewriteRule ^ - [F,L]

(I’m not sure if you have to escape ampersands on .htaccess, but a priori, I’d say you don’t have).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2017-05-31 13:35:03

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: forbid access to a particular query via htaccess

There is also this solution:

RewriteCond %{QUERY_STRING} \brss=1&ru\b [NC]
RewriteRule ^ - [F]

La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2017-05-31 14:08:00

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,032
Website GitHub Mastodon Twitter

Re: forbid access to a particular query via htaccess

Thanks so much Julián

Hmmm none works. I had a similar problem before. It seems that the server ignores the {QUERY_STRING} in the htaccess. I will write to them and I’ll come back here.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB