• 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

xmlxp

Active member
#1
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
#2
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
#3
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