# External to internal Redirect broken

**URL:** <https://community.f5.com/t/external-to-internal-redirect-broken/30977>\
**Category:** Technical Forums\
**Tags:** irules, devops, application-delivery, ltm\
**Created:** [May 19, 2017, 12:21am UTC](https://community.f5.com/t/external-to-internal-redirect-broken/30977 "2017-05-19T00:21:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dradiant\_306130](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@dradiant\_306130](https://community.f5.com/u/dradiant_306130)\
**Post date:** [May 19, 2017, 12:21am UTC](https://community.f5.com/t/external-to-internal-redirect-broken/30977/1 "2017-05-19T00:21:52Z")

</div>

Hi!

Hoping someone could point me in the right direction for a problem I am trying to solve. I’ve gone through the forums and I can’t quite find the right answer (or if it is I don’t understand it).

Use case: User browses to an external facing webpage (An F5 VIP) [https://external.company.com/dev](https://external.company.com/dev)

The F5 offloads the SSL traffic and passes the user through to an internal website: [http://internal.company.com:40000/longstring](http://internal.company.com:40000/longstring)

The issue I have is when I do a redirect with an iRule on my VS it is sending the end user to the internal resource (Which can’t be resolved externally).

The iRule that redirects the user to an internal website that they can’t access:

```tcl
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "external.company.com" } {
    switch -glob [string tolower [HTTP::uri]] {
        "/dev" {
            HTTP::redirect "http://internal.company.com:40000/longstring"
        }
      }  
   }
}

```

Any idea how to proxy the user to an internal website when outside the company?

---

<div class="post-metadata">

**Author:** ![JG](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JG](https://community.f5.com/u/JG)\
**Post date:** [May 19, 2017, 1:51am UTC](https://community.f5.com/t/external-to-internal-redirect-broken/30977/2 "2017-05-19T01:51:05Z")

</div>

Create a server pool internal\_pool with ip\_address\_of\_internal.company.com:40000 as the pool member and then use the following irule:

```tcl
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "external.company.com" } {
    switch -glob [string tolower [HTTP::uri]] {
        "/dev" {
            pool internal_pool
        }
      }
   }
}

```
