Forum Discussion
Drew_123833
Nimbostratus
Mar 23, 2015Redirect full website
Hello everyone I'm trying to redirect my website www.company.com to a sorry page. Due to a database maintenance. I did the redirection through an irule. So far so good. The basic irule to red...
Drew_123833
Nimbostratus
Mar 25, 2015Hi Hannes
Thx for your reply. I did put your first suggestion. The main page will redirect as well. But the /products, /etc. doesn't. The page http://sorry.company.com is on another server/place. Normal the local big ip should do this trick to I guess. Or can we put an extra rule to say that everyting after the slash (/), direct also to sorry.company.com?
- Hannes_RappMar 25, 2015
Nimbostratus
That's not expected. The redirect in the first iRule will trigger regardless of the URI value specified. Only the "www.company.com" string must equal the HTTP Host header. Perhaps your HTTP Host header is something different - does it include a port specification? As per our current solution, a request to http://www.company.com:8080/products will not be redirected to maintenance page, but http://www.company.com/products will be redirected. Can you try the following: I've added a log statement. As you initiate another attempt, take a look at "/var/log/ltm" file to see whether the redirect is triggered or not. priority 10 when HTTP_REQUEST { if { [HTTP::host] == "www.company.com" } { log local0. "[IP::client_addr]: [HTTP::host][HTTP::uri]. Maintenance redirect triggered" HTTP::respond 302 location "http://sorry.company.com" event disable TCP::close } else { log local0. "[IP::client_addr]: [HTTP::host][HTTP::uri]. Maintenance redirect omitted" } }
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