> 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 Extension

With this feature, you can filter out requests by extension. For example, any static files attached to your website that don't need to go through our verification process.

We’ve already implemented for you a basic filter for the most common static files extensions: css, bmp, tif, ttf, docx, woff2, js, pict, tiff, eot, xlsx, csv, eps, woff, xls, jpeg, jpg, doc, ejs, otf, pptx, gif, pdf, swf, svg, ps, ico, pls, midi, svgz, class, png, ppt, mid, webp, jar

**TO define an additional extension:**

1. Open the **PX\_CUSTOM.vcl** file.
2. Add the extension as a regex expression using req.url.ext.

**EXAMPLE**

```java
sub px_custom_filter_by_extension {
  if ((req.request == "GET" || req.request == "HEAD") && req.url.ext ~ "(?i)(css|bmp|tif|ttf|docx|woff2|js|pict|tiff|eot|xlsx|csv|eps|woff|xls|jpeg|jpg|doc|ejs|otf|pptx|gif|pdf|swf|svg|ps|ico|pls|midi|svgz|class|png|ppt|mid|webp|jar)$") {
    set req.http.X-PX-filter-by:extension = "1";
  }
}
```

To learn more about custom subroutines, see [Customized subroutines](https://portal.document360.io/pxconsole/docs/configuration-options-1#customized-subroutines).

**TO enable the feature:**

1. Open the **PX\_CONFIG.vcl** file.
2. Set the px\_filter\_by\_extension\_enabled value to "true" (enabled). The default is "false" (disabled).

```java
table px_configs {
  "px_filter_by_extension_enabled": "true",
}
```

> **Test**
>
> 1. Send a request that includes the new filtered extension.
> 2. Openthe console and search for your request. If you can't find the request, the feature is configured correctly.