Forum Discussion
Rahul_Gupt_2401
Nimbostratus
Feb 19, 2018Problem with URL redirection
I want to do a URL redirection from https://abc.com/v2/ to https://abc.com/xyz/v2/. For this I below irule is not working. Could someone please help in identifying the issue and correct it
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] ends_with "abc.com/v2/" } { HTTP::redirect "; } }
- oguzy
Cirrostratus
Hi Rahul,
"abc.com" is the host part of the url, and "/v2" is the uri. So, you can try that one:
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] ends_with "/v2/" } { HTTP::redirect "https://abc.com/xyz/v2/"; } }
- Lee_Sutcliffe
Nacreous
You do not need a semicolon at the end of the redirect
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] ends_with "abc.com/v2/" } { HTTP::redirect "https://abc.com/xyz/v2/" } }
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects