Search code examples
phpproxyphpbbphpbb3

Deny acces from proxy to my PHP website


Is this even possible?

I have a website running PHPBB3 and there is a user that got banned, but still keeps comming back. I ha ve found out he is using Proxies to bypass his IP ban and new accounts to bypass his accountban.

Is there a way todetermine if the Host is using proxies? or if not is there any website out that list public/free proxies that i can add my ban list?

thank you


Solution

  • Just add these lines to your root .htaccess file

    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]
    

    Read more about this were i learned it, here