# LTM Policy to rewrite URI '/' only on logon

**URL:** <https://community.f5.com/t/ltm-policy-to-rewrite-uri-only-on-logon/14012>\
**Category:** Technical Forums\
**Tags:** ltm-policy, ltm, application-delivery\
**Created:** [January 30, 2018, 9:55pm UTC](https://community.f5.com/t/ltm-policy-to-rewrite-uri-only-on-logon/14012 "2018-01-30T21:55:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ski\_Kacoroski\_2](https://avatars.discourse-cdn.com/v4/letter/s/e79b87/32.png) [@Ski\_Kacoroski\_2](https://community.f5.com/u/Ski_Kacoroski_2)\
**Post date:** [January 30, 2018, 9:55pm UTC](https://community.f5.com/t/ltm-policy-to-rewrite-uri-only-on-logon/14012/1 "2018-01-30T21:55:17Z")

</div>

I have a irule like this that works:

when HTTP\_REQUEST { if { [string tolower [HTTP::host]] equals “[timecard.nsd.org](http://timecard.nsd.org)” } { if { [HTTP::uri] equals “/” } { set uri [string map -nocase {“/” “/wfc/applications/wtk/html/ess/logon.jsp”} [HTTP::uri]] HTTP::uri $uri } } }

That I am trying to put into a policy with this policy rule: timecardv8\_prule { actions { 0 { log write facility local0 message “tcl:Start - [HTTP::uri]” priority info } 1 { http-uri replace value /wfc/applications/wtk/html/ess/logon.jsp } …

My problem is that when I try to use the Replace HTTP:uri selection, it matches all paths, not just the ‘/’ path. This is what I do not want. I could not find anything in searching the documentation and forums. I am running 12.1.2HF1. Thanks for your help.

---

<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:** [January 30, 2018, 10:14pm UTC](https://community.f5.com/t/ltm-policy-to-rewrite-uri-only-on-logon/14012/2 "2018-01-30T22:14:50Z")

</div>

Add a condition to the rule like

```tcl
http-uri path equals any of /

```
