FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How to ban someone's IP from accesing my site?





votd
Just like the topic name says - I want to ban someone's IP and prevent him from accesing my site. I know that this is not possible using DirectAdmin, but I think it is possible in some other way.

Exactly - I want to ban specific IP (my friend IP) from accesing specific folder on my account (specific site created on my account).

Why do I need this? I need privacy - that's the point. And my friend is destroing it, and spying my account. But he didn't found the site he don't like yet (about game genre he don't like :/ - jRPG).

So I am asking you about that. This would be very helpful to me.

I know it is possible, like creating .htaccess - but I don't need to password protect the directory, or it will all go wrong - I want to prevent one person from accessing one directory of my account, that's all. If it's not possible - prevent one person from accesing whole account.

P.S.

Accesing means viewing documents of my site, not accesing my FTP or other...

And I'm talking about my Frihost account if someone don't know Rolling Eyes
krazycapital
Try adding this to the .htaccess:
Code:
<Files 403.shtml>
order allow,deny
allow from all
</Files>

deny from 69.42.67.196
deny from 4.79.248.8

I'm new to this, but I think that the 403.shtml means the file it'll display if they are banned. That should work. If it doesn't you could use php:
Code:
<?php
ob_start();
?>
This is the stuff that'll be displayed if they are safe
<?php
//if the ip isn't iptoban, show content
if ($_SERVER[REMOTE_ADDR] != "iptoban") {
ob_flush();
}
else {
ob_clean();
echo "Go AWAY!!!";
}
//That would mean it's them.
?>
mathiaus
votd wrote:
I know it is possible, like creating .htaccess - but I don't need to password protect the directory, or it will all go wrong - I want to prevent one person from accessing one directory of my account, that's all. If it's not possible - prevent one person from accesing whole account.

That only occurs if you use the .htaccess in your root directory. If you create a new .htaccess in the directory you want to protect what you suggested will work Wink
n0obie4life
Okay..I'll try to get this

Let's say this is my public_html, and they contain these folders

"-->" denotes a folder inside a certain folder

Code:
abc --> bant
def
afda
fdasfasdf --> fdsafas --> 123sa


public_html - if you put the .htaccess file there, it will affect all folders (abc, bant,def, afda, fdsafasdf, fdsafas, 123sa).
If you it in fdsafas, it will affect all of it's subfolders and the folder itself.

I hope you understand it, if you don't, ignore it Razz
Scorpio
I have a question

If the IPs are dynamic will the banning of one specific IP be effective in preventing the unwanted person from accessing the site?

If not, how do you ban dyanmic IPs
n0obie4life
scorpio wrote:
I have a question

If the IPs are dynamic will the banning of one specific IP be effective in preventing the unwanted person from accessing the site?

If not, how do you ban dyanmic IPs


Dynamic IPs are dynamic. They change everytime.

You can ban ranges of IPs, but that would mean banning quite alot of people (but it may differ for different ISPs).

Like for my ISP, I have an dynamic IP, but if you ban me, you are effectively banning almost everyone that is using my ISP (which is, quite alot of them, just here, about 20 people are sharing the same IP as me Smile).
votd
Thank you very much, my problem was solved :]. This could be very helpful to me :]. You are great! I just asked a question, and I checked back day later -whoa! 5 answers and 2 methods to do this. And hopefully - 2 works (I think Smile ). Alot thx.
Related topics
PHP IP Ban
PHP Tutorial: Basic Shoutbox w/ MySQL
Are you blocking ip address of banned users?
A preview account to my site:
A preview account to my site:
Login, database and ban
2 Domains but only 1 is working !!! - Solved -
Question about multiple PCs on 1 internet connection
IP Address Banning ( Not using .htaccess)
Ban Users Ip: 72.265.31.23
Good statistics counter?
What to do if my content is being stolen?
1 ip address = 1 soul
Ban An Ip From Your Website
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.