# F5 XC | Rewrite Redirect functionality

**URL:** <https://community.f5.com/t/f5-xc-rewrite-redirect-functionality/72771>\
**Category:** Technical Forums\
**Created:** [July 25, 2023, 8:00am UTC](https://community.f5.com/t/f5-xc-rewrite-redirect-functionality/72771 "2023-07-25T08:00:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![devd4n](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@devd4n](https://community.f5.com/u/devd4n)\
**Post date:** [July 25, 2023, 8:00am UTC](https://community.f5.com/t/f5-xc-rewrite-redirect-functionality/72771/1 "2023-07-25T08:00:38Z")

</div>

Hi together,

for the migration to F5 XC we need to change the location header for certain responses (301,302) to match the hostname of the XC instance.

Is there currently a way to configure a rewrite redirect to an F5 XC virtual server?  
I also couldn’t find a configuration option that allows response header manipulation.

I am grateful for any hint.

Update:  
i found a feature Request for that functionality:

> **[Rewrite the hostname | F5 Distributed Cloud Ideas and Feature Requests](https://www.f5cloudideas.com/ideas/MESH-I-149)**

but if there are any other ideas pls share with me 🙂

---

<div class="post-metadata">

**Author:** ![devd4n](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@devd4n](https://community.f5.com/u/devd4n)\
**Post date:** [July 25, 2023, 2:09pm UTC](https://community.f5.com/t/f5-xc-rewrite-redirect-functionality/72771/2 "2023-07-25T14:09:00Z")

</div>

Thank you for responding.  
So currently it’s not possible to archive that without placing/re-configuring some servers in front or behind the F5 XC instance. Did i understood that right?

It seems that a direct migration from VM or Hardware F5 Appliance to the XC is currently not completly possible.

---

<div class="post-metadata">

**Author:** ![Nikoolayy1](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nikoolayy1/32/3589_2.png) [@Nikoolayy1](https://community.f5.com/u/Nikoolayy1)\
**Post date:** [August 29, 2023, 2:19pm UTC](https://community.f5.com/t/f5-xc-rewrite-redirect-functionality/72771/3 "2023-08-29T14:19:40Z")

</div>

How about trying the Route option in XC:

 ![Nikoolayy1_0-1693318769743.png](https://d20hrnpixdzcsd.cloudfront.net/original/3X/c/c/cc84395b2c076216227aadf9315d7499c98acde5.png)

 ![Nikoolayy1_0-1693318924036.png](https://d20hrnpixdzcsd.cloudfront.net/original/2X/6/641148c57a7ecb5149cc16c8187ccb42c8952b10.png)

---

<div class="post-metadata">

**Author:** ![devd4n](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@devd4n](https://community.f5.com/u/devd4n)\
**Post date:** [August 29, 2023, 3:42pm UTC](https://community.f5.com/t/f5-xc-rewrite-redirect-functionality/72771/4 "2023-08-29T15:42:57Z")

</div>

[Spoiler](#community-320573-)

Hi Nikoolayy1,

thank you for the hint. Unfortunately this setting only overwrites the host header. I.e. if the target/application server sends a 302 redirect back to itself and not to the FQDN/IP of the XC, the subsequent request is not routed via the XC, but a direct connect to the corresponding target server is performed.

-------------------------------------------------------------------------------------  
Example:

FQDN-XC:&nbsp;www[.][test.ves.io](http://test.ves.io)  
FQDN destination: www[.][test.de](http://test.de)

REQUEST www[.][test.ves.io/redirect/uri](http://test.ves.io/redirect/uri) =\> XC =\>&nbsp;www[.][test.de/redirect/uri](http://test.de/redirect/uri)  
RESPONSE 302 - Location: www[.][test.de/destination/uri](http://test.de/destination/uri) =\> XC

===\> At this moment XC have to rewrite the Location header to it’s own FQDN (Location: www[.][test.ves.io/destination/uri](http://test.ves.io/destination/uri))

-------------------------------------------------------------------------------------

The only particular solution i found is to send all redirects directly for defined uris, but that is not usefull in all cases.

---

<div class="post-metadata">

**Author:** ![Nikoolayy1](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nikoolayy1/32/3589_2.png) [@Nikoolayy1](https://community.f5.com/u/Nikoolayy1)\
**Post date:** [August 29, 2023, 5:57pm UTC](https://community.f5.com/t/f5-xc-rewrite-redirect-functionality/72771/5 "2023-08-29T17:57:24Z")

</div>

Yup, I have seen this as for example if the origin pool is [google.com](http://google.com) then the google servers will send a redirect as the site is [www.google.com,](http://www.google.com,) so I see the only way is for the XC routes to directly send traffic to the origin FQDN that is the final destination, so that a redirect to not be triggered.

Outside of that in the origin pool setting or the XC route you can change the SNI or host value, so the origin pool FQDN to be one thing but the Host/SNI to have another value.

But yes if there was a feature to change the response headers in the HTTP redirect response like the location one.

---

<div class="post-metadata">

**Author:** ![Nikoolayy1](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nikoolayy1/32/3589_2.png) [@Nikoolayy1](https://community.f5.com/u/Nikoolayy1)\
**Post date:** [August 30, 2023, 2:02pm UTC](https://community.f5.com/t/f5-xc-rewrite-redirect-functionality/72771/6 "2023-08-30T14:02:21Z")

</div>

I forgot to add that you can open a feature request at [https://www.f5cloudideas.com/](https://www.f5cloudideas.com/)

---

<div class="post-metadata">

**Author:** ![devd4n](https://avatars.discourse-cdn.com/v4/letter/d/a5b964/32.png) [@devd4n](https://community.f5.com/u/devd4n)\
**Post date:** [August 30, 2023, 2:11pm UTC](https://community.f5.com/t/f5-xc-rewrite-redirect-functionality/72771/7 "2023-08-30T14:11:48Z")

</div>

It allready exists 😉 i posted it inside the question 😉

> **[Rewrite the hostname | F5 Distributed Cloud Ideas and Feature Requests](https://www.f5cloudideas.com/ideas/MESH-I-149)**

nevertheless many thanks 🙂

---

<div class="post-metadata">

**Author:** ![Nikoolayy1](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nikoolayy1/32/3589_2.png) [@Nikoolayy1](https://community.f5.com/u/Nikoolayy1)\
**Post date:** [August 30, 2023, 2:56pm UTC](https://community.f5.com/t/f5-xc-rewrite-redirect-functionality/72771/8 "2023-08-30T14:56:16Z")

</div>

Didn’t see it. Sorry 😀

---

<div class="post-metadata">

**Author:** ![Nikoolayy1](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nikoolayy1/32/3589_2.png) [@Nikoolayy1](https://community.f5.com/u/Nikoolayy1)\
**Post date:** [January 30, 2024, 3:00pm UTC](https://community.f5.com/t/f5-xc-rewrite-redirect-functionality/72771/9 "2024-01-30T15:00:51Z")

</div>

A cool way I found out is deploying nginx in the XC RE that do the response rewrite [Substitutions | NGINX](https://www.nginx.com/resources/wiki/modules/substitutions/) and nginx by default rewrites the urls, so this seems like the solution.

Similar use case is:

[Bolt-on Auth with NGINX Plus and F5 Distributed Cloud](https://community.f5.com/topic/320879)
