Reputation: 43
I have a response.redirect(url)
which goes to another site.
In the event this fails, how should I redirect again to a redirect fail page?
httpmodule
in place. Can it be used?Upvotes: 1
Views: 2129
Reputation: 1706
response.redirect(url) tells browser to request the "url" so you can not control if this url call is failed in browser.
What you can do is do a HTTP GET HEAD to that url first to see if you get http 200 response and then do a response.redirect(url).
Upvotes: 6
Reputation: 498934
This doesn't make much sense - if a redirect fails, how will the server ever find out?
A redirect tells the browser to go to a different page - if this fails, it fails on the browser and the server has no way to know about it.
Upvotes: 1