Forum Discussion
URL redirection
Please help, Need to create iRule:
https://tableau-snd.ucsf.edu/#/site/QA/views/ProjectChartfieldSearch/ProjectChartfieldSearch
/#/site/QA/ : will be same
ProjectChartfieldSearch/ProjectChartfieldSearch : Can be anything
redirect to :
https://tableauqa.ucsf.edu/#/site/QA/views/ProjectChartfieldSearch/ProjectChartfieldSearch
- zamroni777Nacreous
you can use gui based local traffic policy
it avoid scripting type while having better performance than irules.you can use example in this post:
Certificate server name issue--wildcard certificate | DevCentral - MKurutepeNimbostratus
Hi,
F5 iRules usually don’t handle the part after the # in URLs because that part isn't sent to the server. Normally, the iRule below should work for redirection, but the fragment (#) issue might prevent it from functioning as expected:
when HTTP_REQUEST {
if { [HTTP::host] eq "tableau-snd.ucsf.edu" && [HTTP::uri] starts_with "/#/site/QA/" } {
log local0. "Redirecting request: Host - [HTTP::host], URI - [HTTP::uri]"
set new_uri "https://tableauqa.ucsf.edu[HTTP::uri]"
HTTP::redirect $new_uri
} else {
# Log the request that does not match the condition
log local0. "No redirection: Host - [HTTP::host], URI - [HTTP::uri]"
}
}This iRule is meant to redirect requests based on the URI. However, since the fragment part (#) isn’t sent to the server, this approach might not work as intended.
To check if the fragment part is being processed, you can use this simple iRule:
when HTTP_REQUEST {
set uri [HTTP::uri]
log local0. "URI: $uri"
}This iRule will log the URI of incoming requests. You can use it to see if the fragment is included in the URI and determine if it's being processed or not.
Hope this helps.
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