Forum Discussion
Landing
Am trying to have a Irule for a manintainence page for my f5 to send requests to a pool which hosts it
MY current Irule only manages to redirect anything http://xxx.com , however anything which follows a URI say http://xxx.com/ sumthing doesnt work it says 404 error can anyone help please
12 Replies
- Ed_Summers
Nimbostratus
It would be easier to troubleshoot if you post your current rule and a bit more detail on what you are trying to do.
If you simply need to redirect all requests going to a particular host ( you should be able to do so by matching on the host ([HTTP::host]). That should ignore any path information.
- Ed_Summers
Nimbostratus
I didn't see a section in your iRule that looks like you're trying to send certain traffic to a maintenance page. I did find a couple of links that may be helpful if you are trying to create such a redirect. The following links show how to match on the HTTP::host and redirect accordingly. The second link is a helpful example of how to redirect all subdomains of a particular domain.
https://devcentral.f5.com/questions/httphost-and-if-match-redirect-by-using-httpredirect
DevCentral: Match all subdomains of a domain
- Hannes_Rapp
Nimbostratus
Let's be clear, you are not redirecting anything in F5 at this point, all redirects you may receive originate from the end-server. Your iRule is selecting a specific pool, based on the visitors source IP-address. It's all your iRule does.
Now for the Error 404 received when requesting "http://xxx.com/", it is purely related to end-server configuration. If you would like to formulate a maintenance redirect inside F5, have a look at commands
orHTTP::respond 302 location "http://www.maintenance.host"
- both commands invoke a HTTP 302 redirect to your maintenance page location. Cheers.HTTP::redirect "http://www.maintenance.host"- abi1980_184094
Nimbostratus
thanks Hannes Rapp for your valuable comments - abi1980_184094
Nimbostratus
hannes would you be able to explain this part in a little deatil If you would like to formulate a maintenance redirect inside F5, have a look at commands HTTP::respond 302 location "http://www.maintenance.host" or HTTP::redirect "http://www.maintenance.host" - both commands invoke a HTTP 302 redirect to your maintenance page location. Cheers - abi1980_184094
Nimbostratus
Is there an option to modufy the existing Irule to redierect to the maintainece page insteads of pointing it to the pool
- Hannes_Rapp_162
Nacreous
Let's be clear, you are not redirecting anything in F5 at this point, all redirects you may receive originate from the end-server. Your iRule is selecting a specific pool, based on the visitors source IP-address. It's all your iRule does.
Now for the Error 404 received when requesting "http://xxx.com/", it is purely related to end-server configuration. If you would like to formulate a maintenance redirect inside F5, have a look at commands
orHTTP::respond 302 location "http://www.maintenance.host"
- both commands invoke a HTTP 302 redirect to your maintenance page location. Cheers.HTTP::redirect "http://www.maintenance.host"- abi1980_184094
Nimbostratus
thanks Hannes Rapp for your valuable comments - abi1980_184094
Nimbostratus
hannes would you be able to explain this part in a little deatil If you would like to formulate a maintenance redirect inside F5, have a look at commands HTTP::respond 302 location "http://www.maintenance.host" or HTTP::redirect "http://www.maintenance.host" - both commands invoke a HTTP 302 redirect to your maintenance page location. Cheers - abi1980_184094
Nimbostratus
Is there an option to modufy the existing Irule to redierect to the maintainece page insteads of pointing it to the pool
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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