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
- The_Bhattman
Nimbostratus
Working of of Joe's example in another post.
Here is what I would probably dowhen HTTP_REQUEST { if { ([HTTP::host] eq "www.abc.com.au") && ([HTTP::uri] eq "/personalcredit") } {HTTP::redirect "http://[HTTP::host]/abconline/99.aspx"} }
thanks,
CB - Ravi_110217
Nimbostratus
Hi,
your given solution is not working for me... If you have any other solution then it will be too good. I need to sort out this issue ASAP so your quick help will be much more appreciated.
Thanks. - Nicolas_Menant
Employee
Hi,
Have you try to do some troubleshooting to check what was the HTTP::uri value ?
If you want people to help you , some idea about what may be happening would be welcome like doing the following:
when HTTP_REQUEST {
log local0. "uri is [HTTP::uri]"
log local0. "host is [HTTP::host]"
if { ([HTTP::host] eq "www.abc.com.au") && ([HTTP::uri] eq "/personalcredit") } {
log local0. "redirecting user..."
HTTP::redirect "http://[HTTP::host]/abconline/99.aspx"
}
}
And you can then give us the output of /var/log/ltm
May your issue be that you have additionnal stufd after /personalcredit ?
if yes, then try this:
when HTTP_REQUEST {
if { ([HTTP::host] eq "www.abc.com.au") && ([HTTP::uri] starts_with "/personalcredit") } {
HTTP::redirect "http://[HTTP::host]/abconline/99.aspx"
}
}
If this is not your issue, then show us some debugging information so that we can help you understand what is happening because what cmbhatt offered should work.
HTH - Ravi_110217
Nimbostratus
Hi ,
Thanks for your quick response... I have done whatever you have mentioned above but still does not seem to be working. I am not sure how to get log files and how to debug one irule. Your suggestion will be appreciated.
I would like to know that where would I apply this IRULE? Do I need to apply to Virtual Server or somewhere else ? I have got couple of virtual servers but I'm not sure where do I need to apply this rule?
I am very much new with this product and don't know much more about it.... - Ravi_110217
Nimbostratus
HI,
I would also like to know whether request is hitting to our IRULE or not. I dont know whether we can check it or not...
Your help is more appreciated.
Ta, - The_Bhattman
Nimbostratus
The irule needs to be assocated to the VIP that is responsible for handling the www.abc.com.au traffic.
The log local0 arguement, depicted below, is how you output the variables and commands to a log file that you can view. It can tell which line it's being executed.
If you use the following codewhen HTTP_REQUEST { log local0. "uri is [HTTP::uri]" log local0. "host is [HTTP::host]" if { ([HTTP::host] eq "www.abc.com.au") && ([HTTP::uri] eq "/personalcredit") } { log local0. "redirecting user..." HTTP::redirect "http://[HTTP::host]/abconline/99.aspx" } }
To view the debug code, log into the bigip via ssh and then go to /var/log directory. Then type in "tail -f ltm" and then run your tests via browser and see what happens at the log. You should information such as "redirecting user..." or "hosts is www.abc.com.au". - Ravi_110217
Nimbostratus
HI,
I've already tried this rule too but it is not working either. I am wondering that where would I apply this IRULE. I am applying on VIRTUAL server and i hope it is correct...
Your suggestion will be appreciated... - The_Bhattman
Nimbostratus
You would apply this irule under virtual server >> Resources and select manage and add teh irule. Can you also tell us if you are getting ANY output from the ltm logs?
If you are just post them here.
thanks
CB - Ravi_110217
Nimbostratus
Hi,
I'm still not sure how to check logs.... I have never worked on this product before so getting hard to understand it.
Ta, - Ravi_110217
Nimbostratus
Is there any other rule that I can try with ? If you know something , please let me know.
thanks,
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