4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 IP Range Banning
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Wed Jun 02, 2004 1:03 pm (20 years, 5 months ago) Reply with QuoteBack to Top

I have a speed test script on Freedom2Support that is to test the speed of a freedom2surf adsl connection with a 2MB test file, however I want to make it so only people who are on an IP in the:

194.106.*.*
and
195.137.*.*

Ranges can access speedtest.php, how can I do this?
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Wed Jun 02, 2004 3:44 pm (20 years, 5 months ago) Reply with QuoteBack to Top

In an .htaccess file:

Code:
Deny from all
Allow from 194.106.*.*
Allow from 195.137.*.*


I think that should do it.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Wed Jun 02, 2004 6:01 pm (20 years, 5 months ago) Reply with QuoteBack to Top

What do I use though if I want to just protect one page, rather than the whole directory?

As I want to make speedtest.php accessable to F2S IP's only but the rest of the directory avaliable to anyone.
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Wed Jun 02, 2004 8:19 pm (20 years, 5 months ago) Reply with QuoteBack to Top

Try this:

Code:
<Files speedtest.php>
Deny from all
Allow from 194.106.*.*
Allow from 195.137.*.*
</Files>

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Wed Jun 02, 2004 11:49 pm (20 years, 5 months ago) Reply with QuoteBack to Top

Tried that, afraid it seems to ban everyone then, I'm running Apache 2.0.49, if that bears any difference?
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Thu Jun 03, 2004 7:14 am (20 years, 5 months ago) Reply with QuoteBack to Top

Does the code work properly on the whole directory (ie without the <Files> tag)?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Thu Jun 03, 2004 8:15 am (20 years, 5 months ago) Reply with QuoteBack to Top

Nope, gives me a 403 on everything, and as you can see, I'm on a 195.137.*.* IP.
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Thu Jun 03, 2004 8:19 am (20 years, 5 months ago) Reply with QuoteBack to Top

Sorry, I think it's just the syntax which is wrong:

Code:
<Files speedtest.php>
Deny from all
Allow from 194.106
Allow from 195.137
</Files>

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Justin
4WebHelp Addict
4WebHelp Addict


Joined: 07 Jan 2002
Posts: 1060

PostPosted: Thu Jun 03, 2004 8:43 am (20 years, 5 months ago) Reply with QuoteBack to Top

Cheers, that worked perfectly Smile
OfflineView User's ProfileFind all posts by JustinSend Personal MessageSend email
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Thu Jun 03, 2004 10:07 am (20 years, 5 months ago) Reply with QuoteBack to Top

Glad it worked Smile

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.13184 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme