Knowledgebase

>> Portal Home > Knowledgebase > PHP and scripts > How can I block proxy servers via htaccess


How can I block proxy servers via htaccess

In order to block proxy servers via .htaccess copy and paste following code into your root .htaccess:

 

RewriteEngine on

RewriteCond %{HTTP:VIA}                 !^$ [OR]

RewriteCond %{HTTP:FORWARDED}           !^$ [OR]

RewriteCond %{HTTP:USERAGENT_VIA}       !^$ [OR]

RewriteCond %{HTTP:X_FORWARDED_FOR}     !^$ [OR]

RewriteCond %{HTTP:PROXY_CONNECTION}    !^$ [OR]

RewriteCond %{HTTP:XPROXY_CONNECTION}   !^$ [OR]

RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR]

RewriteCond %{HTTP:HTTP_CLIENT_IP}      !^$

RewriteRule ^(.*)$ - [F]

 


You should be able to block 99% of proxy servers coming to your site.



Was this answer helpful?

Also Read
What is PHP (Views: 137)

Powered by WHMCompleteSolution

Language: