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

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
 

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>
 

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
 
Top