Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2011
    Posts
    4
    Plugin Contributions
    0

    Default block ip country

    How to block viewer ( country ) by .Htaccess ?

    please step by step

  2. #2
    Join Date
    Jan 2011
    Location
    India
    Posts
    1
    Plugin Contributions
    0

    Default Reply

    Quote Originally Posted by peapea View Post
    How to block viewer ( country ) by .Htaccess ?

    please step by step

    I don't known about it.






    Nojja567
    Katha

  3. #3
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: block ip country

    Yu will need to determine the countrys range of ip's or CIDR

    The following site will generate a CIDR deny list for you to paste into your htaccess file

    Just select IP ranges by Ip Country Location and output as CIDR

    http://www.find-ip-address.org/ip-country/
    Zen-Venom Get Bitten

  4. #4
    Join Date
    Dec 2008
    Location
    Atlanta, GA/Panama City, Panama
    Posts
    30
    Plugin Contributions
    0

    Default Re: block ip country

    Can someone tell me which folder does the .htaccess file belong in? I have found the list to block IP's online, I placed it in my .htaccess file but I noticed that several folders have an .htaccess file so which one should have this information to ban certain visitors? Currently I have placed the code in every .htaccess file I found and added my own IP and of course I can still see my site.

    This is the file I added to my .htaccess file:

    <Files *>
    order allow,deny
    deny from 127.0.0.1 (I changed this to my IP address)
    allow from all
    </Files>

    Is this correct?

    Thanks in advance for your help.
    Vee

    Add Info: When I add the code to all the .htaccess files I have found, when I try to log into my Zencart admin, I get an error page that my hosting providers says is a corrupt .htaccess file.
    Last edited by veedub3; 2 Oct 2012 at 02:17 PM.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: block ip country

    Zen Cart comes with .htaccess files located INSIDE SUBDIRECTORIES ONLY. YOU DO NOT EDIT THESE FILES.

    Zen Cart specifically comes with NO .htaccess file in the root of your store, because Zen Cart doesn't need one there in order to run.

    So:
    1. Remove all the things you just added to the existing .htaccess files located in various subdirectories under your Zen Cart folders.
    2. Then add your own new .htaccess file into the root of your store ... that would be the same folder as files like ipn_main_handler.php
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Dec 2008
    Location
    Atlanta, GA/Panama City, Panama
    Posts
    30
    Plugin Contributions
    0

    Default Re: block ip country

    Thank you very much that did it.

    Vee

  7. #7
    Join Date
    Jun 2009
    Posts
    1
    Plugin Contributions
    0

    Idea or Suggestion Re: block ip country

    Quote Originally Posted by veedub3 View Post
    Thank you very much that did it.

    Vee
    After talking to my server tech support they informed me that blocking ip addresses through the .htaccess or ip deny in my control panel will eventually effect the visitors that I want to show up and access my site because the the IP addresses are always changing globally. users IP in china, ukraine or russia may become an ip address for some user in the us therefore blocking potential customers in the us... check with your server and verify my findings.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: block ip country

    Quote Originally Posted by firedealer View Post
    ... because the the IP addresses are always changing globally. users IP in china, ukraine or russia may become an ip address for some user in the US therefore blocking potential customers in the US...
    IMO that's a bit of a stretch. While it's technically possible, it's relatively rare that IPs change to represent different country locations.

    Nevertheless, it is wise to regularly review any IP addresses you've blocked to be sure you still need/want to block them.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v139h PayPal shipping address country will change to other country problems.
    By explorer1979 in forum General Questions
    Replies: 0
    Last Post: 18 Feb 2014, 02:42 AM
  2. Shipping only to one country, but Billing from any country
    By mask2011 in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 21 Aug 2010, 07:29 AM
  3. What is the best method to block country access?
    By IntelCos in forum General Questions
    Replies: 5
    Last Post: 10 May 2009, 09:31 AM
  4. Paypal Express returning country not recognized after I deleted country/zone data
    By danilyn22 in forum PayPal Express Checkout support
    Replies: 0
    Last Post: 23 Apr 2009, 12:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR