Hi, I am using this same redirect iRule I used for http to https which works flawlessly for me (except the irule below is stripped from the
Now all I want is a simple redirect from www.helloworld.com to “http://maintenance.mydomain.com”. Right now, when someone types in helloworld.com on their browser, it works perfectly by redirecting to “http://maintenance.mydomain.com”. However, the problem is when someone comes in to the site following a URL that contains a path “http://www.helloworld.com/aboutus.html” the iRule does this “http://maintenance.mydomain.com/aboutus.html”. I don’t have a page “aboutus.html” so it returns an error on the browser.
How can I make the redirect not carry over the path and strip it off completely so no matter what path they’re trying to access and as long as the hostname contains “helloworld” to redirect it to exactly http://maintenance.mydomain.com ?
Here is the iRule I’m using for the redirect
when HTTP_REQUEST {
if { [HTTP::host] contains "helloworld"} {
HTTP::redirect http://maintenance.mydomain.com[HTTP::uri]
}
}