Forum Discussion

nbresto's avatar
nbresto
Icon for Nimbostratus rankNimbostratus
Dec 01, 2023

F5 LTM Vanity URL Rewrite

Hi all,

Pretty new to F5 and have taken over management of a pair. I am having trouble updating some rewrite vanity urls.

I need users to be able to put in the URL "example.com" and for the URL to stay the same but for the page to show contents from an external website of "test.com/test".

 

Currently we have this iRule in place:
when HTTP_REQUEST {
        "example.com"
        {
             HTTP::header replace "Host" "placeholder.com"
             HTTP::header insert "X-Forwarded-Host" "example.com"
             HTTP::uri "/example[HTTP::uri]"
         }

  }

When I try to update the iRule I change the "placeholder.com" with "test.com" and update the HTTP:uri with "/example[HTTP::uri]" with "/test[HTTP::uri]" but when I then go to "example.com" I get the following error:
"Not found. HTTP Error 404. The requested resource is not found."

Just looking for some advice on where I'm possibly going wrong, stuff I need to be aware of or if someone can point me in the right direct.

Appreciate any info. Thanks.