Govin_48123
May 12, 2008Nimbostratus
Masking the URI and also redirecting!
Hi Gurus,
Below is the scenarios I am trying to implement, and need some help,
Case 1)User Types in http://www.site.com/, the application server basically does a 301 redirect to http://www.site.com/home. What I am trying to implement is instead of the appserver doing the redirect I want to handle that at the F5,
http://www.site.com/ should be redirected to http://www.site.com/home with 200 response code and the address bar should show http://www.site.com/
Case 2)User Types in http://www.site.com, I want to redirect to http://www.site.com/ with 301 response code which then follows through case1).
Case 3) User types in http://www.site.com/home then the Client gets response directly form the appserver, Irule doesnt need to handle this at all.
Below is the Irule that I have but its not perfect,The Uri doesnt get masked)Can you tell me what I am missing!
Thanks
-G
Irule:
when HTTP_REQUEST {
set uri [HTTP::uri]
if { $uri equals "/" } {
HTTP::respond 301 Location "http://site.com/home"
}
elseif { $uri equals "" } {
HTTP::respond 200 Location "http://site.com/"
}
}