How to manage access to the website based on user's IP address or geo location
The premium Complete Package v6.0.7+ allows to define granular access controls to any specific URL or event entire website based certain criteria like user's IP address, referring website, query param or geographical location. In this article we cover a couple of popular example of this functionality.
Geo-based access controls
There are scenarios where managing access to website resources or the entire website based on a user's geographical location becomes imperative. AAM seamlessly integrates with IPStack (please note that we are not affiliated with them) to convert a user's IP address into a precise geographical location.
The premium Complete Package features a flexible abstraction layer that facilitates integration with any Geo-location service, provided they offer an API for integration. If you have a preference for a different Geo-location provider, we can integrate with them upon request, incurring no additional costs.
To initiate this process, the first step is to configure AAM by supplying the IPStack license key. Head to the "ConfigPress" tab on the "Settings" page.
Once the setup is complete, returning to the "Access" page will reveal additional criteria types such as country, continent, or zip code in the "URL Access Rule" modal on the "URL Access" tab.
From this point onwards, one can define conditions based on geographical location. For instance, in a few simple steps, access to the entire website can be restricted to users from England, France, and the US.
- Switch to manage visitors on the "Users & Roles widget."
- Navigate to the "URL Access" tab and select the "+ Create" button.
- In the provided form, insert
*(wildcard) for the "Enter URL" input to target all URLs on the website. If you also have AAM Protected Media Files plugin installed, similar way you can protect your physical files and media items.
- Choose the "Deny" option and set the condition by selecting "Country Name" as the "Criteria Type."
- Opt for "Not In" as the condition type and enter "France, England, United States" in the third input field.
- Save the configuration.
Query param access control
Similar to geo-location access control, access management based on query parameters in the URL is possible. For example, access to a page can be allowed if the URL contains parameters like
pass=98jkd8. Creating a new rule on the "URL Access" tab and choosing the "Query Param" option for the "Criteria Type" facilitates this control.
Referring host access control
Last but not least, controlling access based on the referring website is a powerful feature. This is particularly useful when allowing access from affiliated locations or specific intranet pages. To implement this access control, select "Referring Host" from the "Criteria Type" drop-down.
In conclusion, the AAM Complete Package v6.0.7+ empowers website administrators with unparalleled access control, offering flexibility and granularity. Whether it's based on geographical location, query parameters, or referring hosts, AAM provides a comprehensive solution to tailor access to your website according to your specific requirements.