How To Block a Visitor From Viewing My Site?

6 replies
Hi warriors

I want to know how to block a person from viewing my site? can any body explain in detail as i don't know any thing about it? Please help me warriors. I am using wordpress so is there anyone knows how to block a person?

James
#block #site #viewing #visitor
  • Profile picture of the author Bujuk
    maybe you can be more specific. are you refering to one particular person? or are you referring to for members only? or are you referring the whole world not be able to see your site?

    reason why I'm asking, the approach is different. the first one is bit difficult to do. the second and third one are quite easy.

    if you can clarify, maybe we can help out the details.
    Signature
    “Have no fear of perfection - you'll never reach it.”
    - Salvador Dalí
    {{ DiscussionBoard.errors[791390].message }}
  • Profile picture of the author jjpmarketing
    If its a public site, about the only way to block them is by blocking their ip address. This will only work for so long if they have a dynamic ip. Eventually it will change and then they will be able to access your site again. If they have a static ip this will work really well.

    If they are using proxies to view your site, then you will have to keep blocking proxy ip addresses.

    That is about all you can do to block them, unless they are using a user name and password to login to your site. If that is the case, then you could setup a fake site and redirect their login to the fake site.

    IT Security people use this method to prevent DDOS attacks and things like that. It is referred to as using a "Honey Pot".

    Hope that helps.

    Dennis
    {{ DiscussionBoard.errors[791395].message }}
  • Profile picture of the author mmurtha
    Originally Posted by jamesjoin View Post

    Hi warriors

    I want to know how to block a person from viewing my site? can any body explain in detail as i don't know any thing about it? Please help me warriors. I am using wordpress so is there anyone knows how to block a person?

    James

    James,

    If you go into your host cpanel, you should see an icon with the words "Deny IP address" or something similar. Just add the IP address or block of addresses you want to deny. Once their IP address is added to this list, your server will deny it, and they cannot view your site or blog.

    Just remember, if their IP address changes or if they are using a proxy, you will have to re-enter their new IP addresses. Proxies are a bit difficult to block, but you can block an entire IP block or group in one swipe.
    {{ DiscussionBoard.errors[791422].message }}
  • Profile picture of the author CBSnooper
    If you know their IP address you can block them using .htaccess - If you don't know, the .htaccess file is a file that lives in the directory of your website where your files are than can control how your site behaves (put simplistically!).

    Check the root www directory. If there isn't a .htaccess file there, you can create one using your favourite text editor. It's a hidden file so make sure your ftp program is set to show hidden files.

    Put it in the same directory as your index.php or index.html file. If there is, add it to the end of the file.

    In the .htaccess file put the following:

    <Files 403.shtml>
    order allow,deny
    allow from all
    </Files>


    deny from xxx.xxx.xxx.xxx

    where xxx.xxx.xxx.xxx is the ip address you want to ban. If you want to ban more than one ip address, add more deny from lines.
    {{ DiscussionBoard.errors[791431].message }}
  • Profile picture of the author BurgerBoy
    You can block anything you want to with the following code in your .htaccess file.

    Use the following code :

    <Limit GET POST>
    #The next line modified by DenyIP
    order allow,deny
    #The next line modified by DenyIP
    #deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>

    <Files 403.shtml>
    order allow,deny
    allow from all
    </Files>

    SetEnvIfNoCase User-Agent .*Twiceler.* bad_bot
    SetEnvIfNoCase User-Agent .*VoilaBot BETA 1.2.* bad_bot
    SetEnvIfNoCase User-Agent .*libwww-perl/5.805.* bad_bot
    SetEnvIfNoCase User-Agent .*Java/1.5.0_11.* bad_bot
    SetEnvIfNoCase User-Agent .*Sogou web spider/3.0.* bad_bot
    SetEnvIfNoCase User-Agent .*psbot.* bad_bot
    SetEnvIfNoCase User-Agent .*Exabot.* bad_bot
    SetEnvIfNoCase User-Agent .*Charlotte/1.0b.* bad_bot
    SetEnvIfNoCase User-Agent .*boitho.com-dc.* bad_bot
    SetEnvIfNoCase User-Agent .*ajSitemap.* bad_bot
    SetEnvIfNoCase User-Agent .*bot/1.0.* bad_bot
    SetEnvIfNoCase User-Agent .*panscient.com.* bad_bot
    SetEnvIfNoCase User-Agent .*Java/1.6.0_11.* bad_bot
    SetEnvIfNoCase User-Agent .*WebDataCentreBot/1.0.* bad_bot
    SetEnvIfNoCase User-Agent .*Java.* bad_bot
    SetEnvIfNoCase User-Agent .*SapphireWebCrawler.* bad_bot
    SetEnvIfNoCase User-Agent .*Yandex.* bad_bot
    SetEnvIfNoCase User-Agent .*Baiduspider.* bad_bot
    SetEnvIfNoCase User-Agent .*Rankivabot.* bad_bot
    SetEnvIfNoCase User-Agent .*DBLBot/1.0.* bad_bot

    order allow,deny
    deny from env=bad_bot
    allow from all


    These are the bots I'm banning right now. IP address does not matter - they will still be banned.

    As you find new ones just keep adding new lines to the banned list.

    As you add new lines remember to keep the .* at the front and ending of the item you want blocked.
    Signature
    {{ DiscussionBoard.errors[791647].message }}
  • Profile picture of the author jasonl70
    If you want to just block individuals (instead of building a membership type site), there is a plugin for WP that will do this. It's called "WP-Ban"
    Signature

    -Jason

    {{ DiscussionBoard.errors[792030].message }}

Trending Topics