Forum Discussion
Advice to partial rename uri path
- Jul 23, 2024
That's some very specific stuff you're trying to achieve ..
If the "client URL" you want to display does not exist on the server, I think you'll need two instructions in the iRule, one to redirect client to target URI and one to change this string before it connects to the webserver.
You might try something similar to this
when HTTP_REQUEST { if { [HTTP::host] equals "companyA.com" }{ #I'm using a switch statement so it's easier to add/change uri behavior in the future switch -glob [HTTP::path] { "/" { HTTP::redirect "https://[HTTP::host]/bed/table/r/Home" } "/bed/table/r/Home" { HTTP::path "/room/desktop/r/Home" } } } }
That's some very specific stuff you're trying to achieve ..
If the "client URL" you want to display does not exist on the server, I think you'll need two instructions in the iRule, one to redirect client to target URI and one to change this string before it connects to the webserver.
You might try something similar to this
when HTTP_REQUEST {
if { [HTTP::host] equals "companyA.com" }{
#I'm using a switch statement so it's easier to add/change uri behavior in the future
switch -glob [HTTP::path] {
"/" { HTTP::redirect "https://[HTTP::host]/bed/table/r/Home" }
"/bed/table/r/Home" { HTTP::path "/room/desktop/r/Home" }
}
}
}
Hi master!
Greetings! again. Is it okay to ask again for confirmation if you are still available? I notice in the code that because the path of our homepage has changed and masked the path on the side of client's browsers. What if our clients press a button containing a link to another path? would that give us an error 404 since the path the browser knows is the "/bed/table/...../"?
So, if lets say they click a login page button with a link at supposed uri path "/room/desktop/r/Home/Login" from "/room/desktop/r/Home" and this was masked to "/bed/table/r/Home"... Will client's browser able to direct to "/room/desktop/r/Home/Login" with the mask uri path or will this give them an error 404 code since the browser will shoot an HTTP get request header of path "/bed/table/r/Home/Login" when clients click the page's login link/button?
Apologies for the too many questions. This is my 1st time programming and use TCL/irule language. :)
Respectfully,
Zeig
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com