# whitelist URL

**URL:** <https://community.f5.com/t/whitelist-url/56093>\
**Category:** Technical Forums\
**Tags:** irules, big-ip-access-policy-manager-apm, application-delivery\
**Created:** [September 13, 2021, 9:34am UTC](https://community.f5.com/t/whitelist-url/56093 "2021-09-13T09:34:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FAJUMO](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@FAJUMO](https://community.f5.com/u/FAJUMO)\
**Post date:** [September 13, 2021, 9:34am UTC](https://community.f5.com/t/whitelist-url/56093/1 "2021-09-13T09:34:04Z")

</div>

I have a VS, accessed externally, required is for all access to the VS blocked except the whitelisted URL in the datagroup.

Need an irule to achieve this

---

<div class="post-metadata">

**Author:** ![oguzy](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@oguzy](https://community.f5.com/u/oguzy)\
**Post date:** [September 13, 2021, 12:02pm UTC](https://community.f5.com/t/whitelist-url/56093/2 "2021-09-13T12:02:09Z")

</div>

Hi Fajumo,

You can try the floowing:

```tcl
when HTTP_REQUEST {
  if { not ([class match [HTTP::uri] contains your_datagroup_name]) } {
    drop
  }
}

```

---

<div class="post-metadata">

**Author:** ![FAJUMO](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@FAJUMO](https://community.f5.com/u/FAJUMO)\
**Post date:** [September 13, 2021, 12:23pm UTC](https://community.f5.com/t/whitelist-url/56093/3 "2021-09-13T12:23:16Z")

</div>

Hello Oguzy,

I have applied it and asked them to test.

Will update you on the outcome.

Thanks so much
