# F5 Rewrite Rule

**URL:** <https://community.f5.com/t/f5-rewrite-rule/69478>\
**Category:** Technical Forums\
**Tags:** application-delivery\
**Created:** [March 29, 2022, 8:29pm UTC](https://community.f5.com/t/f5-rewrite-rule/69478 "2022-03-29T20:29:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinod1](https://avatars.discourse-cdn.com/v4/letter/v/aeb1de/32.png) [@vinod1](https://community.f5.com/u/vinod1)\
**Post date:** [March 29, 2022, 8:29pm UTC](https://community.f5.com/t/f5-rewrite-rule/69478/1 "2022-03-29T20:29:00Z")

</div>

Hello,

Working on a requirement where I need to rewrite SiteA to SiteB but Post changes I want to retain SiteA URL ([https://dev.test.domain.com/pathxyz](https://dev.test.domain.com/pathxyz))

Site A - [https://dev.test.domain.com/pathxyz](https://dev.test.domain.com/pathxyz)

Site B - [https://dev.test.domain.com/authentication](https://dev.test.domain.com/authentication)

I tried below irule, but it shows Site B instead i want Site A to be displayed.

Can some one please suggest me,

when HTTP\_REQUEST {  
if { [HTTP::uri] starts\_with “/[pathxyz](https://dev.test.domain.com/pathxyz)” } {  
set uri [string map -nocase {“/[pathxyz](https://dev.test.domain.com/pathxyz)” “/[authentication](https://dev.test.domain.com/authentication)”} [HTTP::uri]]  
HTTP::uri $uri  
}  
}

---

<div class="post-metadata">

**Author:** ![Mayur\_Sutare](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/mayur_sutare/32/5035_2.png) [@Mayur\_Sutare](https://community.f5.com/u/Mayur_Sutare)\
**Post date:** [March 30, 2022, 6:35am UTC](https://community.f5.com/t/f5-rewrite-rule/69478/2 "2022-03-30T06:35:11Z")

</div>

Hi&nbsp; @vinod1 &nbsp;You can try same using rewrite profile as given below -

 ![Mayur_Sutare_0-1648622070347.png](https://d20hrnpixdzcsd.cloudfront.net/original/2X/c/c415a824e8ff0091bf7b9806e603adc27ba72dd0.png)

Ref -&nbsp;[https://techdocs.f5.com/kb/en-us/products/big-ip\_ltm/manuals/product/ltm-implementations-12-1-0/17.html](https://techdocs.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm-implementations-12-1-0/17.html)

---

<div class="post-metadata">

**Author:** ![vinod1](https://avatars.discourse-cdn.com/v4/letter/v/aeb1de/32.png) [@vinod1](https://community.f5.com/u/vinod1)\
**Post date:** [March 30, 2022, 4:20pm UTC](https://community.f5.com/t/f5-rewrite-rule/69478/3 "2022-03-30T16:20:43Z")

</div>

Thank you Mayur. Its working using rewrite profile

But i had to add ‘/’ at the end of the URL because while creating the profile F5 would not allow with out ‘/’
