1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 limit access to index.php?login/login

Discussion in 'Troubleshooting and Problems' started by xmlxp, Feb 12, 2012.

  1. xmlxp

    xmlxp Active Member

    I really need to limit some IP blocks from accessing the registration page index.php?login/login using .htaccess. so they can browse the board but they cant register

    the reason why I dont use (Prevent discouraged IP addresses from registering) option because it prevent also browsing the board which is somthing Idont want
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    This .htaccess code appears to work:

    Code:
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    
    	RewriteCond %{REMOTE_ADDR} ^12\.34\.56\.78$
    	RewriteCond %{QUERY_STRING} ^login/login$
    	RewriteRule ^.*$ - [F,L]
    </IfModule>
    
    Or to specify an IP block:

    Code:
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    
    	RewriteCond %{REMOTE_ADDR} ^12\.34\..+$
    	RewriteCond %{QUERY_STRING} ^login/login$
    	RewriteRule ^.*$ - [F,L]
    </IfModule>
    
     
  3. xmlxp

    xmlxp Active Member

    Thank you jake for your reply

    is it possible to use country code instead of IP adress? because its realy very long lists of IP adresses
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That is a little more involved:

    http://www.spambutcher.com/art1/317912/
     

Share This Page