How to use Firewall

Learn how to create firewall rules that redirect or block requests based on a visitor’s country and path.

Firewall rules let you control who can access specific parts of your site and where visitors are sent. For example, you can block traffic from Turkey, redirect visitors in France to a French locale, or apply different behavior to a specific section of your site. Firewall is available on Enterprise plans and with the Advanced Hosting add-on.

What is Firewall?

Firewall lets you create rules that combine a path with one or more countries, then redirect or block matching requests.

Common use cases include:

  • Blocking visitors from a specific country from accessing your entire site.

  • Redirecting visitors from a specific country to a localized version of your site.

  • Blocking access to a particular path for visitors in selected countries.

  • Redirecting a group of dynamic URLs while preserving part of the original path.

Firewall rules are separate from Framer’s automatic protection against attacks, which is always active and requires no setup. Learn more in How our active DDoS protection works.

Add a firewall rule

  1. Open Site SettingsHostingFirewall.

  2. Click Add.

  3. Enter the path you want to match.

  4. Select one or more countries.

  5. Choose Redirect or Block. If you choose Redirect, enter the destination in Redirect To.

  6. Click Add to save the rule.

  7. Publish or update your site to apply the change.

Match a path

Choose a path template based on the requests you want to match:

  • Exact Path matches a single path. For example, /pricing matches /pricing, but not /pricing/enterprise.

  • Path and Subpaths matches a path and everything below it. For example, /blog/* matches /blog and paths such as /blog/hello-world.

  • Wildcard uses * as a standalone path template to match paths across your site. For example, /* matches every path. To match a section and all of its subpaths, use Path and Subpaths instead.

  • Parameter uses a named value, such as :slug, to match one dynamic segment. For example, /blog/:slug matches /blog/hello-world, with hello-world captured as the slug parameter.

Use Exact Path or Path and Subpaths to target a specific area of your site.

To apply a rule to your entire site, use the Wildcard template with /*.

You can also invert a path condition. Open the menu next to the path condition and choose Invert Condition to make the rule match requests that do not meet the selected path condition. For example, to redirect visitors in France to a French locale without creating a redirect loop, invert the Path and Subpaths condition /fr/*, select France, and redirect to /fr/:1. This excludes requests already on the French locale.

Match a country

Select one or more countries to apply the rule based on a visitor’s location. Every rule requires at least one country.

To match all countries except those you selected, open the menu next to Country and choose Invert Condition. The label changes to Country Is Not.

For example, you could select France and invert the condition to apply a rule to visitors from every country except France.

Redirect matching requests

Choose Redirect to send matching requests to another destination. You can use these destination formats:

  • Exact URL redirects visitors to a complete URL.

  • Exact Path redirects visitors to a path on your site.

Block matching requests

Choose Block to prevent matching requests from accessing your site. Block uses the same path and country conditions as redirects, including inverted conditions.

When a request matches a block rule, Framer rejects the request instead of loading the requested page. The visitor cannot access the matching path while the rule applies.

Practical examples

You can combine paths, countries, and actions to handle common access and localization scenarios.

Block traffic from Turkey

To prevent visitors in Turkey from accessing your entire site, match Turkey with the Wildcard path /*, then choose Block.

Redirect visitors in France to a French locale

To send visitors in France to a French version of your site without redirecting visitors already on that locale, invert the Path and Subpaths condition /fr/*, select France, choose Redirect, and set the destination to /fr/:1. This preserves the rest of the requested path while preventing a loop.

To prevent visitors in selected countries from accessing a particular section, use Path and Subpaths. For example, matching /downloads lets you block /downloads and the paths below it for the countries you select.

Manage rules and priority

Firewall rules are evaluated in the order they appear in the list. Drag rules to change their order.

To edit or remove a rule, open its menu.

Changes to your rules do not affect your live site until you publish or update the site. This includes reordering, editing, and deleting rules. A deleted rule remains active on the live site until you publish again.

If you need more help, contact Framer’s support team through our contact page.

FAQ

Can I apply a firewall rule to my entire site?

Yes. Use the Wildcard path template with /* to match paths across your entire site. You still need to select at least one country for the rule.

Why is my firewall rule not active yet?

Firewall changes only take effect after you publish or update your site. This also applies when you edit, reorder, or delete an existing rule.

Can I create a rule for every country except specific countries?

Yes. Select the countries you want to exclude, open the menu next to Country, and choose Invert Condition. The condition changes to Country Is Not, so the rule matches visitors outside the selected countries.

Updated

Your next idea starts here

GPT 5.6 Terra

Create personal portfolio

Build startup site

Launch landing page

Start company blog

Framer UI showing Pages, Layers and Assets panels titles
Framer UI showing Pages, Layers and Assets panels titles