> This page is for Applications Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# Filter by Route

In case you don’t want to enforce your entire website topology, you can filter out specific routes using the Filter by Route feature.

**TO define filtered routes:**

1. Open the **PX_CUSTOM.vcl** fie.
2. Add the required routes as a regex expression using req.url.path.

**EXAMPLE**

```javascript
sub px_custom_filter_by_route {
   if (req.url.path ~ {"^/prefix|^/exact/match$"}) {
      set req.http.X-PX-filter-by:route = "1";
   }
}
```

To learn more about custom subroutines, see [Customized subroutines](/applications/fastly-customized-subroutines).

**TO enable the feature:**

**v8.0.0 and up**

1. Open the **PX_CONFIG.vcl** file.
2. Set the **px_filter_by_route_enabled** value to "true" (enabled). The default is "false" (disabled).

```javascript
table px_configs {
  "px_filter_by_route_enabled": "true",
}
```

**v7.2.0 and below**

1. Open the **PX_CONFIG.vcl** file.
2. Set the **ENABLE_WHITELISTED_ROUTES** value to "1" (enabled). The default is "0" (disabled).

```javascript
table px_configs {
  "ENABLE_WHITELISTED_ROUTES": "1",
}
```

> **Test**
>
> 1. Send a request to one of the defined routes.
> 2. Openthe console and search for your request. If you can't find the request, the feature is configured correctly.