My website is running on InfinityFree hosting and it ads ?i=1
suffixes (like www.mysite.com/?i=1
, or /?i=2
, or /?i=3
) to every URL to protect websites against malicious bots, as they say.
But of course, I don't like these suffixes and want to disable them (simply redirecting www.mysite.com/anypage/?i=1
to www.mysite.com/anypage/
). Note that I don't want to disable all GET parameters, but only these i=1
, i=2
and i=3
.
I think it could be done using .htaccess
. Can someone help me, please?
Well, I've solved the problem using a code from this question. I've just added this code in my .htaccess, and now it redirects all the URLs with "i" to the URLs without it.
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)i=[^&]+(.*)$ [NC]
RewriteRule ^(.*)$ /$1?%1%2 [R=301,L]
You need to turn the RewriteEngine on first.
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.*)i=[^&]+(.*)$ [NC]
RewriteRule ^(.*)$ /$1?%1%2 [R=301,L]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With