In some scenarios, you might want to restrict access to your website based on the visitor's IP address. This recipe makes it easy to set up this type of restriction using redirection.io.
This recipe is perfect for the following cases:
- internal testing environments (e.g., pre-production, qualification, staging, etc.)
- restrict access to sensitive content such as administration areas or features still in beta
- compliance with legal or operational access restrictions
- limit access to specific geographical regions
- avoid exposing content that is not quite finalized to the public or search engines
- restrict pre-launch access to selected users
- block known malicious IP addresses
- etc.
If the visitor's IP address matches one of the authorized addresses, they will be able to access the site normally, transparently. Otherwise, they will be presented with a 403 Forbidden status code and custom error response content.
This recipe can be configured to apply to the entire site or to specific URLs (e.g., /beta
, /internal
, or /admin
). You can of course customize the trigger URL to suit your needs (match a single domain or subdomain, etc.).
This recipe is therefore an ideal solution for agencies, product teams, or regulated industries — anyone needing fast and reversible access control without touching the site's backend infrastructure.
How to install this recipe on my website with redirection.io?
Installing this recipe on your website requires the following steps:
Installation Steps:
- Enter the restricted path or URL: In the installation form, specify the URL or path you wish to protect (e.g.,
/beta
,/internal
, or/
to restrict the entire site). You can even specify a precise (sub-)domain, eg.://www.example.com/page
. - List allowed IP addresses: Enter the IP addresses that should be allowed to access this URL (e.g.,
192.0.2.1, 198.51.100.22, 203.0.113.7
). - Click on the "Install on My Website" button: this will create one rule in "Draft" mode.
- Review the created rules: review the newly created rules and edit them if necessary. In particular, you may want to edit the content of the 403 Forbidden response to provide more context to your users.
- Publish on your website: Once you're satisfied, publish the rules to activate the IP restriction. Within secinds, the selected rule will be applied to all users who are not on the allowlist.