DM_5174
Feb 08, 2011Nimbostratus
HTTP REDIRECT AND KEEPING URI AFTER DOMAIN NAME
Hi All,
I was wondering if I can get a little help here. I have an existing irule that will redirect and add the "www" if
users forgets to put this in...so if they type "http://mysite.com", it will redirect them to "http://www.mysite.com".
The question here is, I have two additional link that was recently added, so when users add "/app1" or "/app2"
it does not keep this URI but just redirect them back to "www.mysite.com".
What we want to accomplish is: (The URI should be a variable, so this can be anything after www.mysite.com/...."
user enters: http://mysite.com/app1 should get redirect to: http://www.mysite.com/app1
Should NOT happen (URI "app1" is lost or any variable in the future): http://mysite.com/app1 --> http://www.mysite.com
In the future the "/app1" can be anything...we would like to keep this like http://www.mysite.com/$variable
Also, keep existing functionality when user enters "http://mysite.com" --> STILL REDIRECTS TO --> http://www.mysite.com
Thanks for everyone's help.
EXISTING IRULE
when HTTP_REQUEST {
if { [HTTP::host] equals "mysite.com" } {
HTTP::redirect "http://www.mysite.com"
} else {
pool WEB_HTTP_POOL1
}
}