Restricting IP access to a specific website page
Good morning, everyone. Mine is Joel Santos and I'm here with a little problem. The company I work for has a website with an online store and I would like to restrict this page only to some countries where we cannot sell. We cannot sell in those countries because there are stores that sell our products and we do not want to compete with them.
I'm not an expert in programming so I appreciate all the help given.
-
Hello @Joel86 There are a few ways to do this, the easiest might be to block the country from your site/server all together using the CC blocking of CSF (If you're using it).You can read about CC blocking with CSF here: You could also implement a ModSecurity rule for this but it would take some customization, we've got another thread on that here: Alternatively, you could add an .htaccess to the folder where the store portion of the site lives and do a .htaccess block but the number of blocks you'd have to implement to block even one country would be pretty huge. There are some tools that can help with this, some helpful information might be found here: 0 -
Hello. Thank you for the quick answer. I just need to block the store page. Sorry but im not an expert but I'm looking at the last option. Is it possible to get some help? 0 -
Hi Joel Are you a web site owner only. Do you have access to Cpanel. ? I'm not sure that you could impliment CSF or ModSecurity if you don't have access to WHM, (a web site owner wouldn't have this), and I don't believe CPanel has such a feature either. I'd suggest trying to do something with your .htaccess file which resides in the root of your public_html folder. This external web page might help you achieve this, it gives a step by step guide. 0 -
Hi, you should do this on the store app level, e.g. if you are using Woocommerce, just restrict buying in your shipping zone(s). This would enable you to also notify the customers outside your shipping zones to go to somewhere else (maybe your reseller in another country), and wouldn't restrict all access with "dirty" error or message that "you are not welcome here". Let them browse your goods, but go buy it from your local reseller in your own country for example. Any shopping / online store app should have similar options. Now, all this assuming you really actually don't need to _block_ them, just restrict selling to these countries. - Wallu 0
Please sign in to leave a comment.
Comments
4 comments