Forum Discussion
WildCard Redirection of url
hi,
i want to create an irule with following request can anyone help.
I need to publish a url abc-reporting.domain.com
User is requesting the if anyone type anything before abc-reporting.domain.com redirect it to https:// abc-reporting.domain.com/index.html
Example below.
anything.abc-reporting.domain.com redirect it to https://abc-reporting.domain.com/index.html
*.abc-reporting.domain.com redirect it to https://abc-reporting.domain.com/index.html
i tried to create any irule but i am not sure what i am missing please have a look
when HTTP_REQUEST { if { (([HTTP::uri] equals ".abc-reporting.domain.com")) }{ HTTP::redirect "; } }*
Solution to my question
when HTTP_REQUEST {
if { not ([ string tolower [HTTP::host]] contains "abc-reporting.domain.com") } { Redirect to below URL HTTP::redirect "; } }
Thanks for your support and suggestion.
- Lee_SutcliffeNacreous
You should be able to use an LTM Traffic Policy to do this simple redirect, this can all be completed in the WebUI and doesn't require any iRule knowledge.
However if you wish to use an iRule you could use this one
when HTTP_REQUEST { if {[HTTP::host] ends_with "abc-reporting.domain.com"} { HTTP::redirect "https://abc-reporting.domain.com/index.html" } }
- Muntazir_Lala_2Altostratus
Solution to my question
when HTTP_REQUEST {
if { not ([ string tolower [HTTP::host]] contains "abc-reporting.domain.com") } { Redirect to below URL HTTP::redirect "; } }
Thanks for your support and suggestion.
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