Forum Discussion
URL Redirect
Want to rewrite the source URL. Is the syntax correct?
when HTTP_REQUEST { if { "[HTTP::host]" equals “http://port80.port.com”} { HTTP::redirect "https://port80.port.com:8040/OA_HTML/AppsLocalLogin.jsp" }}
4 Replies
- Kevin_Stewart
Employee
Pretty close:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals “port80.port.com” } { HTTP::redirect "https://port80.port.com:8040/OA_HTML/AppsLocalLogin.jsp" } } - jmolchin_47123
Nimbostratus
Something is still wrong in line two. I'm getting the following..
01070151:3: Rule [/Common/http-to-8040] error: line 2: [parse error: PARSE syntax 71 {syntax error in expression " [string tolower [HTTP::host]] equals “port80.port.com...": unexpected operator &}] [{ [string tolower [HTTP::host]] equals “port80.port.com” }]
- Thomas_Gobet
Nimbostratus
Your problem is due to quotes.
Replace them with real quotes, same than those before and after your https url and it will work. - jmolchin_47123
Nimbostratus
That was it! good catch
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