Forum Discussion
Query on redirection
Hello All,
I have the below URL redirection requirement and I'm not sure if this is possible or not.
https://abcd.maintenance.com needs to be redirected to https://www.maintenance.com
where
https://abcd.maintenance.com/management & https://abcd.maintenance.com/reports should not be effected after redirection.
Requesting your kind help on this using iRule or redirect policy, thanks in advance.
-Cyril
3 Replies
- Greg_Labelle_31
Nimbostratus
Based on your example, are you asking that only the root uri "/" be redirect, and not "/management", or are you asking that the URI just not be manipulated? - Theo_12742
Cirrus
Certainly. You can access the HTTP::host and HTTP::uri variables and evaluate them separately.
I'd suggest using the Policy for readability, but the iRule would look like (untested):
when HTTP_REQUEST { if { [HTTP::host] == "abcd.maintenance.com" and ([HTTP::uri] == "/" or [HTTP::uri] == "") } { redirect "https://www.maintenance.com/" } } - Cyril
Nimbostratus
Hi Greg, Thanks for your swift response. If I access the domain alone "https://abcd.maintenance.com" it should be redirected to https://www.maintenance.com. But the above redirection should not impact the below URLs when accessed. https://abcd.maintenance.com/management & https://abcd.maintenance.com/reports should not be effected after redirection.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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