F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

Danny_Arroyo's avatar
Oct 30, 2014

Rewrite an HTTP request

We are running v11.4.1 on our Bigip F5. I know how to rewrite url's with an irule however I'm not sure how to go about rewriting the following. A link (which cant be changed) on one of our websites points to "https://webserver.mycompany.com/cp/render.UserLayoutRootNode.uP?uP_tparam=utf&utf=%2fcp%2fip%2flogin%3fsys%3dsctssb%26url%3dhttp://webserver2.mycompany.com/devl/twbkwbis.P_GenMenu?name=bmenu.P_FinInfoMnu". We need the F5 to look for this HTTP request and when it sees "http://webserver2.mycompany.com", it should rewrite it to "https://webserver2.mycompany.com". Everything else around the HTTP request needs to stay untouched. Can I use a rewrite profile, irule, or some other method to get this done? How would I do this?

 

4 Replies

  • Create new profile using the rewrite uri translation profile to get this completed. Set the rule type as request in your case.

     

  • I'm not very good with this but based on what you wrote, this is what I did: 1. Profiles/Services/Rewrite 2. Click "Create New Profile". Entered a name, chose /Common/rewrite-uri-translation for the "Patent Profile" and set "Uri Translation" for the "Rewrite Mode" 3. Under "URI Translation/Settings/Request Settings", "Rewrite Headers" and "Insert X-Forwarded-For Header" are checked. 4. Under "URI Translation/Settings/Response Settings", "Rewrite Headers" and "Rewrite Content" are checked. 5. Under "URI Rules", I clicked "Add" and selected "Request" for "Rule Type". Then for the "Client URI", I pasted in "https://webserver.mycompany.com/cp/render.UserLayoutRootNode.uP?uP_tparam=utf&utf=%2fcp%2fip%2flogin%3fsys%3dsctssb%26url%3dhttp://webserver2.mycompany.com/devl/twbkwbis.P_GenMenu?name=bmenu.P_FinInfoMnu". 6. For "Server URI" I pasted in the same string but with the https instead of http.

     

    However, when I click OK to save it, I get the following error:

     

    MCP Error01070734:3: Configuration error: /Common/name_uri_rewrite: Client path '/cp/render.UserLayoutRootNode.uP?uP_tparam=utf&utf=%2fcp%2fip%2flogin%3fsys%3dsctssb%26url%3dhttp://webserver2.mycompany.com/devl/twbkwbis.P_GenMenu?name' must begin and end with '/'

     

    I probably have it misconfigured, but can't tell where the problem is. Any ideas?