If end user type an URL http://www.a.com to access a web server, but the default directory of web server is empty, how to write an iRule to redirect the web page to http://www.a.com/abc automatic so client can access another directory of web server?
You can use HTTP::redirect (Click here for the wiki page) to redirect clients that make a request for the root document to the /abc URI:
when HTTP_REQUEST {
if {[HTTP::uri] eq "/"}{
HTTP::redirect http://[HTTP::host]/abc
}
}
If the requested URI isn’t /, the client request won’t be modified and they will be sent to the pool.
Aaron
(Edited to add [] around HTTP::uri)
Thanks, I will try it.