# redirect

**URL:** <https://community.f5.com/t/redirect/11926>\
**Category:** Technical Forums\
**Created:** [September 15, 2015, 10:41am UTC](https://community.f5.com/t/redirect/11926 "2015-09-15T10:41:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![siphiwe\_222099](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@siphiwe\_222099](https://community.f5.com/u/siphiwe_222099)\
**Post date:** [September 15, 2015, 10:41am UTC](https://community.f5.com/t/redirect/11926/1 "2015-09-15T10:41:58Z")

</div>

hi guys,

im new on F5 and we recently implemented and Active/Passive pair, the is one particular site i published which is [https://12345.co.za](https://12345.co.za) and its suppose to redirect to [http://54321.co.za/abc.](http://54321.co.za/abc)

i have tried a couple irules i found here and non of them worked for me, unless im doing it wrong or missing something.

would appreciate any help.

thanks in advance.

Siphiwe.

---

<div class="post-metadata">

**Author:** ![stan\_piron](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@stan\_piron](https://community.f5.com/u/stan_piron)\
**Post date:** [September 15, 2015, 10:48am UTC](https://community.f5.com/t/redirect/11926/2 "2015-09-15T10:48:10Z")

</div>

Hi,

the best way is to create a local traffic policy (version 11.4 and above) with the following rule:

- condition :
  - http-host equals 12345.co.za
  - http-uri path equals /

- Action :
  - http-reply redirect /abc

---

<div class="post-metadata">

**Author:** ![siphiwe\_222099](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@siphiwe\_222099](https://community.f5.com/u/siphiwe_222099)\
**Post date:** [September 15, 2015, 6:35pm UTC](https://community.f5.com/t/redirect/11926/3 "2015-09-15T18:35:45Z")

</div>

hi Stanislas,

thanks for the reply, but im struggling to get this working let me give you more info,

site [https://trustme.someone.co.za](https://trustme.someone.co.za) is open an IIS page instead of redirecting to

i tried adding the policy rule in different ways but i just cant get it right, more details using the examples above would really help

thanks again

---

<div class="post-metadata">

**Author:** ![sha\_01\_139339](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@sha\_01\_139339](https://community.f5.com/u/sha_01_139339)\
**Post date:** [September 15, 2015, 10:30pm UTC](https://community.f5.com/t/redirect/11926/4 "2015-09-15T22:30:33Z")

</div>

Hi

Are you having the SSL termination on the F5. I can see that the first one is https site

Thanks

---

<div class="post-metadata">

**Author:** ![siphiwe\_222099](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@siphiwe\_222099](https://community.f5.com/u/siphiwe_222099)\
**Post date:** [September 16, 2015, 5:07am UTC](https://community.f5.com/t/redirect/11926/5 "2015-09-16T05:07:16Z")

</div>

yes, im doing ssl termination on F5.

---

<div class="post-metadata">

**Author:** ![sha\_01\_139339](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@sha\_01\_139339](https://community.f5.com/u/sha_01_139339)\
**Post date:** [September 16, 2015, 6:17am UTC](https://community.f5.com/t/redirect/11926/6 "2015-09-16T06:17:46Z")

</div>

Did you try this one ?

when HTTP\_REQUEST { if { [string tolower [HTTP::host]] equals “trustme.someone.co.za” } { HTTP::redirect “” } }

---

<div class="post-metadata">

**Author:** ![stan\_piron](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@stan\_piron](https://community.f5.com/u/stan_piron)\
**Post date:** [September 16, 2015, 7:23am UTC](https://community.f5.com/t/redirect/11926/7 "2015-09-16T07:23:13Z")

</div>

the same as sha 01 irule but with a policy:

```tcl
ltm policy policy-trustme.someone.co.za {
    controls { forwarding }
    requires { http }
    rules {
        redirect-trustme.someone.co.za {
            actions {
                0 {
                    http-reply
                    redirect
                    location http://wemadeit.together.ccom/DOIT
                }
            }
            conditions {
                0 {
                    http-host
                    host
                    values { trustme.someone.co.za }
                }
            }
            ordinal 1
        }
    }
    strategy first-match
}

```

to import it: **tmsh load sys config merge from-terminal** , paste the code and press CTRL-D

---

<div class="post-metadata">

**Author:** ![sha\_01\_139339](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@sha\_01\_139339](https://community.f5.com/u/sha_01_139339)\
**Post date:** [September 16, 2015, 5:33pm UTC](https://community.f5.com/t/redirect/11926/8 "2015-09-16T17:33:05Z")

</div>

Policy looks ok. This should have worked. May be can you try updating the require list with client-ssl as well. Also can you please provide the VS config

---

<div class="post-metadata">

**Author:** ![stan\_piron](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@stan\_piron](https://community.f5.com/u/stan_piron)\
**Post date:** [September 17, 2015, 9:22am UTC](https://community.f5.com/t/redirect/11926/9 "2015-09-17T09:22:14Z")

</div>

Hi,

Does the policy redirect from [http://trustme.someone.co.za](http://trustme.someone.co.za) to ?

to troubleshoot, try firefox with firebug extension to follow requests
