# Rule that redirects and keeps tracking code

**URL:** <https://community.f5.com/t/rule-that-redirects-and-keeps-tracking-code/16920>\
**Category:** Technical Forums\
**Tags:** irules, dev, v4, devops, application-delivery\
**Created:** [August 30, 2006, 4:51pm UTC](https://community.f5.com/t/rule-that-redirects-and-keeps-tracking-code/16920 "2006-08-30T16:51:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_Chick\_152](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@Bryan\_Chick\_152](https://community.f5.com/u/Bryan_Chick_152)\
**Post date:** [August 30, 2006, 4:51pm UTC](https://community.f5.com/t/rule-that-redirects-and-keeps-tracking-code/16920/1 "2006-08-30T16:51:31Z")

</div>

I don’t fully understand what is happening here, but I will try to explain.

We have the following information in our external DNS structure:

Host A: [thejettareport.com](http://thejettareport.com) --\> 64.207.133.221

Host A: [www.thejettareport.com](http://www.thejettareport.com) --\> 199.5.47.99

The 199.5.47.99 IP is a VIP on the BigIP that redirects traffic based on uri/url content for [thejettareport.com](http://thejettareport.com). I’m not sure what the the “[www.thejettareport.com](http://www.thejettareport.com) --\> 199.5.47.99” record is used for. The issue is that the “tracking code” is not included when users hit the redirect to the f5, as shown below:

[http://thejettareport.com](http://thejettareport.com) --\> includes tracking code

[http://www.thejettareport.com](http://www.thejettareport.com) --\> DOES NOT include tracking code

This is expected behavior. My question:

Is there a way/rule for the f5 to feed the tracking code for the redirects that occur because a user hits “[www.thejettareport.com](http://www.thejettareport.com)”?

Hopefully this is clear. I will include below the email that was originally given to me. (I’m a network guy; not WebOps.)

Thanks,

Bryan

We are having what appears to be a domain issue for [thejettareport.com](http://thejettareport.com) domain. When I click through from google or yahoo to [thejettareport.com](http://thejettareport.com), there appears to be a server-side redirect occurring from [http://www.thejettareport.com](http://www.thejettareport.com) to [http://thejettareport.com](http://thejettareport.com)

This is only an issue because the paid keywords from google and yahoo contain a query string tracking code that gets eliminated in this redirect.

When you click through on this link, the tracking code does not appear in the query string. Beyond Interactive has confirmed that that keyword is definitely associated with an appropriate tracking code.

In fact, if you load “[http://www.thejettareport.com?ic\_id=12345](http://www.thejettareport.com?ic%5C_id=12345)” you will see the redirect, and the tracking code eliminated from the query string

If you load “[http://thejettareport.com?ic\_id=12345](http://thejettareport.com?ic%5C_id=12345)” you will see the tracking code retained in the query string.

Do you know how to prevent this server side redirect from happening? It is impacting our click-through numbers in Omniture.

---

<div class="post-metadata">

**Author:** ![Martin\_Machacek](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Martin\_Machacek](https://community.f5.com/u/Martin_Machacek)\
**Post date:** [August 31, 2006, 5:27pm UTC](https://community.f5.com/t/rule-that-redirects-and-keeps-tracking-code/16920/2 "2006-08-31T17:27:41Z")

</div>

Bryan,

yes, you can preserve the tracking information in the URI using following construnct in your rule:

```tcl
redirect to "http://thejettareport.com" + http_uri

```

Please refer to BIG-IP Reference Guide for details.
