Forum Discussion
Ravi_110217
Nimbostratus
Mar 11, 2008new HTTP page redirection request
Hello GuYs,
I am wondering if someone could help me out with HTTP page redirection rule... I have tried with couple of rules but none of them worked. See example below that how do I want to redirect web page...
redirect from
www.abc.com.au/presonalcredit to
www.abc.com.au/abconline/99.aspx.
If you could give me an idea that which rule needs to write to get page redirect working.
Hope to hear soon.
Ta,
29 Replies
- Nicolas_Menant
Employee
Hi,
For what you are trying to achieve this is the method and it should work.
To see the log file you have two ways to do it:
GUI: System > logs > local traffic
CLI: tail /var/log/ltm (it will show the last lines) or less /var/log/ltm
HTH - Ravi_110217
Nimbostratus
Here is my log file: My IRULE name is Once_Credit_Redirection
Thu Mar 13 05:58:22 EST 2008 PRNLBW01 mcpd[1093] 01070417 AUDIT - user AcRNetNetw0rk - transaction 13220169-1 - object 0 - create { virtual_server_rule { virtual_server_rule_virtual_server_name HTTP-VS virtual_server_rule_rule_name drop_rule virtual_server_rule_priority 4 } }
Thu Mar 13 05:58:22 EST 2008 PRNLBW01 mcpd[1093] 01070417 AUDIT - user AcRNetNetw0rk - transaction 13220165-1 - object 0 - create { virtual_server_rule { virtual_server_rule_virtual_server_name HTTP-VS virtual_server_rule_rule_name Redirect_no_servers_available virtual_server_rule_priority 3 } }
Thu Mar 13 05:58:22 EST 2008 PRNLBW01 mcpd[1093] 01070417 AUDIT - user AcRNetNetw0rk - transaction 13220161-1 - object 0 - create { virtual_server_rule { virtual_server_rule_virtual_server_name HTTP-VS virtual_server_rule_rule_name Once_Credit_Redirection virtual_server_rule_priority 2 } }
Thu Mar 13 05:58:22 EST 2008 PRNLBW01 mcpd[1093] 01070417 AUDIT - user AcRNetNetw0rk - transaction 13220157-1 - object 0 - create { virtual_server_rule { virtual_server_rule_virtual_server_name HTTP-VS virtual_server_rule_rule_name HTTPS-redirect virtual_server_rule_priority 1 } }
Thu Mar 13 05:58:22 EST 2008 PRNLBW01 mcpd[1093] 01070417 AUDIT - user AcRNetNetw0rk - transaction 13220153-1 - object 0 - create { virtual_server_rule { virtual_server_rule_virtual_server_name HTTP-VS virtual_server_rule_rule_name payonce-out-of-action virtual_server_rule_priority 0 } }
Thu Mar 13 05:58:22 EST 2008 PRNLBW01 mcpd[1093] 01070417 AUDIT - user AcRNetNetw0rk - transaction 13220149-1 - object 2361 - obj_delete { virtual_server_rule { virtual_server_rule_virtual_server_name HTTP-VS virtual_server_rule_rule_name payonce-out-of-action } }
Thu Mar 13 05:58:22 EST 2008 PRNLBW01 mcpd[1093] 01070417 AUDIT - user AcRNetNetw0rk - transaction 13220145-1 - object 2362 - obj_delete { virtual_server_rule { virtual_server_rule_virtual_server_name HTTP-VS virtual_server_rule_rule_name HTTPS-redirect } }
Thu Mar 13 05:58:22 EST 2008 PRNLBW01 mcpd[1093] 01070417 AUDIT - user AcRNetNetw0rk - transaction 13220141-1 - object 2363 - obj_delete { virtual_server_rule { virtual_server_rule_virtual_server_name HTTP-VS virtual_server_rule_rule_name Redirect_no_servers_available } }
Thu Mar 13 05:58:22 EST 2008 PRNLBW01 mcpd[1093] 01070417 AUDIT - user AcRNetNetw0rk - transaction 13220137-1 - object 2364 - obj_delete { virtual_server_rule { virtual_server_rule_virtual_server_name HTTP-VS virtual_server_rule_rule_name drop_rule } }
Thu Mar 13 05:58:00 EST 2008 PRNLBW01 mcpd[1093] 01070417 AUDIT - user AcRNetNetw0rk - transaction 13219418-1 - object 2330 - modify { rule { rule_name Once_Credit_Redirection rule_definition when HTTP_REQUEST { log local0uri is [HTTP::ur log local0host is [HTTP::hos if { [HTTP::host] ehttp://www.oncecredit.com. [HTTP::uri] e/personalcred } { log local0redirecting user. HTTP::redirechttp://[HTTP::host]/OnceOnline/99.as } } } } - Ravi_110217
Nimbostratus
Please let me know if you find out something from log file....
Thanks. - hoolio
Cirrostratus
The log snippet you added above doesn't include any log output from the iRule. Do you have the rule Once_Credit_Redirection added as a resource on the virtual server? Do you see in the ltm log file lines like:
uri is /someuri
host is somehost.example.com
If you make a request via a browser to the virtual server by hostname, you should see at least those two log lines for every request. If you don't see these lines, make sure the hostname you're making a request to resolves to the virtual server IP address. Also make sure that the virtual server you've added the rule to is the correct protocol (ie, if you're making an https request to the IP address, the VIP should be defined on 443).
Aaron - Ravi_110217
Nimbostratus
HI,
I have added irule to HTTP on port 80 which is defined in VIRTUAL server. I am not sure how to check these two lines in log as I can't see anything apart from what I have added above.
I am also wondering that if I can see whether my request is hitting to right VIRTUAL server address or somewhere else....
If you have any idea, please let me know.
Thanks. - The_Bhattman
Nimbostratus
If you go to the /var/log/ltm file you should see the following listed
uri is [HTTP::uri]
host is [HTTP::host] - The_Bhattman
Nimbostratus
This is probably would your code should look likewhen HTTP_REQUEST { log local0. "uri is [HTTP::uri]" log local0. "host is [HTTP::host]" if { ([HTTP::host] eq "www.oncecredit.com") && ([HTTP::uri] eq "/personalcredit") } { log local0. "redirecting user..." HTTP::redirect "http://[HTTP::host]/OnceOnline/99.aspx" } }
thanks,
CB - Ravi_110217
Nimbostratus
HI,
I am logged into the CLI interface and typing tail /var/log/ltm but nothing is happening except getting an error message that directory not found....
I have tried couple of different commands also but still nothing happening.
Your suggestion will be much more appreciated.
THanks. - The_Bhattman
Nimbostratus
Can you post the logs? - Ravi_110217
Nimbostratus
HI,
Sorry to bother you.. Could you tell me what command do I need to type in CLI to get latest logs... I can't see updated logs in GUI....
Thanks heaps..
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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