What do you mean by "1st one doesn't work" ? That the server is sending an error ?
It's not possible to do what you want just with HTML.
It could be done by Javascript by adding a listener to the anchor, sending HTTP request on the first url to see if you receive 200 or an error like 500.
In case of an error, you check the second url and so on and redirect the user where you received a 200.
Otherwise, if you just want to open all the links, there was already a post about that here: How can I open multiple links using a single anchor tag