Post by SherryM » Sun Nov 03, 2019 9:36 pm

Hi
I'm using the default template with 3.0.2.0 and have been getting a lot of spam emails and was wondering is there anyway I can have my website only work for people in the USA I don't ship outside of USA so I don't see any reason for my website to be available for outside USA. I tried to get the google capatche to work but I can not get it to work at all so Im using just the basic one. Thank you.

New member

Posts

Joined
Thu Apr 19, 2018 3:26 am

Post by DigitCart » Sun Nov 03, 2019 9:40 pm

Hi
I have a commercial extension that can stop spams:
https://www.opencart.com/index.php?rout ... n_id=37705

My Extensions / DigitCart


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by thekrotek » Sun Nov 03, 2019 10:03 pm

No extension can disable access to your site from other countries. The only option is to do it via .htaccess.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by letxobnav » Sun Nov 03, 2019 10:33 pm

No extension can disable access to your site from other countries. The only option is to do it via .htaccess
There is nothing which htaccess can do which php cannot.

Still, blocking countries on ip address is risky as ip address ranges are vigorously traded between countries given the shortage of them.
So you may end up blocking an ip you think is outside the US when in fact it no longer is.
Of course you can say "well, so I have a few false positives, I can live with that", then sure you can give it a try.

But to make it extra futile, most spammers (and hackers) simply rent computers at amazon, rackspace or one of the other cloud services in the US and those have all US ip addresses.

There are many remedies for countering spam, country ip blocking is the worst choice.
The easiest thing you can do right now is to check and block the enquiry on the presence of "://" for links and "!" for bad manners, for some reason spammers love the exclamation mark, I hate it.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by thekrotek » Sun Nov 03, 2019 11:04 pm

letxobnav wrote:
Sun Nov 03, 2019 10:33 pm
There is nothing which htaccess can do which php cannot.
Of course, it does. And blocking by country with PHP is quite lame.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by letxobnav » Sun Nov 03, 2019 11:17 pm

nope, and blocking by htaccess is no less dumb.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by thekrotek » Mon Nov 04, 2019 12:09 am

letxobnav wrote:
Sun Nov 03, 2019 11:17 pm
nope, and blocking by htaccess is no less dumb.
Of course, it is much less dumb and the most recommended way to achieve the task.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by paulfeakins » Mon Nov 04, 2019 7:43 pm

thekrotek wrote:
Mon Nov 04, 2019 12:09 am
letxobnav wrote:
Sun Nov 03, 2019 11:17 pm
nope, and blocking by htaccess is no less dumb.
Of course, it is much less dumb and the most recommended way to achieve the task.
There are things .htaccess can do that PHP cannot, but blocking by IP is not one of them because both can do it.

It makes sense to do this from PHP if you want to block a country because you can query a cached copy of an IP database to make sure you have the latest IPs for any given country.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by paulfeakins » Mon Nov 04, 2019 7:45 pm


For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by letxobnav » Mon Nov 04, 2019 7:59 pm

There are things .htaccess can do that PHP cannot
name one.

Yes, you can query ip to country databases but even those are not 100% up to date and as I said, all it takes is renting a cloud instance in the US, Europe or in any country you are targeting making your ip blocking futile.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by paulfeakins » Mon Nov 04, 2019 8:07 pm

letxobnav wrote:
Mon Nov 04, 2019 7:59 pm
There are things .htaccess can do that PHP cannot
name one.
Apply a PHP setting to every script by adding something like this to .htaccess:

Code: Select all

php_value memory_limit 512M

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by thekrotek » Mon Nov 04, 2019 8:23 pm

paulfeakins wrote:
Mon Nov 04, 2019 7:43 pm
It makes sense to do this from PHP if you want to block a country because you can query a cached copy of an IP database to make sure you have the latest IPs for any given country.
This only complicates things and adds unnecessary query/redirection rules. If you want to simply block people from some country .htaccess is your best friend for it will do it instantly and without any query/redirection hassle.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by paulfeakins » Mon Nov 04, 2019 8:25 pm

thekrotek wrote:
Mon Nov 04, 2019 8:23 pm
This only complicates things and adds unnecessary query/redirection rules. If you want to simply block people from some country .htaccess is your best friend for it will do it instantly and without any query/redirection hassle.
You're right that it might quicker (although databases are more optimized for this than files), but it might not always be correct i.e. it might block some IPs that are not in that country or it might not block some IPs that are.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by thekrotek » Mon Nov 04, 2019 8:30 pm

paulfeakins wrote:
Mon Nov 04, 2019 8:25 pm
You're right that it might quicker (although databases are more optimized for this than files), but it might not always be correct i.e. it might block some IPs that are not in that country or it might not block some IPs that are.
And you won't make it more correct with PHP approach either. In my opinion, blocking the whole country is plain stupid.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by paulfeakins » Mon Nov 04, 2019 8:34 pm

thekrotek wrote:
Mon Nov 04, 2019 8:30 pm
And you won't make it more correct with PHP approach either. In my opinion, blocking the whole country is plain stupid.
This is a good site if that is what you want to do though:
https://www.ip2location.com/

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom
Who is online

Users browsing this forum: pprmkr, stefg and 30 guests