Forum Discussion
Hi,
the following irule should works for you :
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/efgh/abc/" } {
HTTP::respond 302 Location "https://abcd.com:8443/efgh/abc" Connection Close
}
}
- Mr_Ten_280720Jul 22, 2016Nimbostratus
ITS NOT WORKING HIC HIC
Jul 22 16:36:20 slot1/F5ExtDC warning mcpd[7748]: 01071859:4: Warning generated : /Common/https2https:2: warning: [deprecated usage, use else or elseif][ ] Jul 22 16:36:20 slot1/F5ExtDC err mcpd[7748]: 01070151:3: Rule [/Common/https2https] error: /Common/https2https:2: error: ["unexpected end of argument sequence."][log] /Common/https2https:2: error: [undefined procedure: local0.][local0.] /Common/https2https:2: error: [undefined procedure: test][if { [string tolower [HTTP::uri]] starts_with "/way4acs/enroll/" } log local0. "test" { HTTP::respond 302 Location "https://acbd.com:8443/efgh/abc/" Connection Close } ] Jul 22 16:36:35 slot1/F5ExtDC warning mcpd[7748]: 01071859:4: Warning generated : /Common/https2https:2: warning: [deprecated usage, use else or elseif][ ]
- Yann_Desmarest_Jul 22, 2016Nacreous
Can you post the complete irule because you get warnings and errors on different parts ?
- boneyardJul 22, 2016MVP
please use the 4th icon from the right (Preformated Code) to make your output more readable. and provide the full irule then because the output suggest you didn't only copy paste what yann showed.
- Mr_Ten_280720Jul 25, 2016Nimbostratus
Hi all, When I do Yann Desmarest's irule. Its not working , I've changed irule to log bug but its seem not working too. Pls check this rule to fix and log local. Thanks when HTTP_REQUEST {
- janholtz_40468Jul 25, 2016Nimbostratus
Unnecessary "}{" between log and respond: when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "/way4acs/enroll/" } { log local0. " This is the URI to redirect == [HTTP::uri]" HTTP::respond 302 Location "https://esecure.acb.com.vn:8443/way4acs/enroll/" Connection Close }
Better
- Mr_Ten_280720Jul 25, 2016Nimbostratus
Hi all,
New log irule when I adjust my rule
Jul 25 11:19:19 slot1/F5ExtDC err mcpd[7748]: 01070151:3: Rule [/Common/https2https] error: /Common/https2https:1: error: [command is not valid in the current scope][if { [string tolower [HTTP::uri]] starts_with "/way4acs/enroll/" } { log local0. " This is the URI to redirect == [HTTP::uri]" HTTP::respond 302 Location "https://esecure.acb.com.vn:8443/way4acs/enroll/" Connection Close }] /Common/https2https:6: error: [command is not valid in the current scope][}]
- boneyardJul 25, 2016MVP
please use the 4th icon from the right (Preformated Code) to make your output more readable. and provide the full irule because the output suggest you didn't only copy paste what yann and janholtz showed.