# Conditional Forwarding

**URL:** <https://community.f5.com/t/conditional-forwarding/23138>\
**Category:** Technical Forums\
**Tags:** dev, irules, devops, application-delivery\
**Created:** [November 30, 2009, 2:41pm UTC](https://community.f5.com/t/conditional-forwarding/23138 "2009-11-30T14:41:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Puneet\_73909](https://avatars.discourse-cdn.com/v4/letter/p/ac8455/32.png) [@Puneet\_73909](https://community.f5.com/u/Puneet_73909)\
**Post date:** [November 30, 2009, 2:41pm UTC](https://community.f5.com/t/conditional-forwarding/23138/1 "2009-11-30T14:41:57Z")

</div>

Hi All,

Need ur Help!!!

I have a situation where I need to restrict access to one of my website url from outside world and allow it from internal network.

suppose:

When user types in [www.xyz.com](http://www.xyz.com), request should forward it to normal webservers.

But If user types in [.xyz Domain Names | Join Generation XYZ](http://www.xyz.com/doc), then he will get outage page but it should be accessible via 10.10.1.1 subnet.

Please help me to acheive this condition.

Thanks,

Puneet Khanna

---

<div class="post-metadata">

**Author:** ![JRahm](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/jrahm/32/3327_2.png) [@JRahm](https://community.f5.com/u/JRahm)\
**Post date:** [November 30, 2009, 4:12pm UTC](https://community.f5.com/t/conditional-forwarding/23138/2 "2009-11-30T16:12:54Z")

</div>

Something like this maybe?

```tcl
when HTTP_REQUEST { 
   if { [string tolower [HTTP::uri]] starts_with "/doc" && !([IP::addr [IP::client_addr]/24 equals 10.10.1.0]) } { 
     HTTP::redirect "http://my.outage.page" 
   } 
 }

```

---

<div class="post-metadata">

**Author:** ![hoolio](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@hoolio](https://community.f5.com/u/hoolio)\
**Post date:** [November 30, 2009, 4:50pm UTC](https://community.f5.com/t/conditional-forwarding/23138/3 "2009-11-30T16:50:08Z")

</div>

The problem with doing URI checking like this is that it would be simple to bypass. There are some examples of URI obfuscation methods in this post:

Irule for restricting URL paths unsecure

[http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=30900](http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=30900)

It would be more secure to have one VIP for internal users which filters only by client IP address and a second VIP which points at a version of the app that doesn’t allow access to this URI from anyone.

Aaron
