The first issue, and that's why I've put the "return 0" in, is the combinantion with multiple Irules. Allthough I've put the return 0 in, I still see (In the logging) the next Irule is being hit and therefore the maintanance doesn't show. So I have to remove all irules from the VS and just put the maintanance Irule on Why?
you need event disable command.
event wiki
https://devcentral.f5.com/wiki/iRules.event.ashx
iRules: Disabling Event Processing by Deb Allen
https://devcentral.f5.com/articles/irules-disabling-event-processing.Us2X4bSjbIU
The second issue is for example I put the maintanance on a VS which listens to www.x.com So when I type www.x.com the maintanance page shows up. But for example when I type in www.x.com/something , the maintance text shows up but the images aren't shown. I would like to see the images when I type www.x.com/something. Is there a way to optimize this Irule to achieve this?
the image is not shown because the image request also contains /something (e.g. /something/logo.gif). the /something is included because you do not change url at client.
for workaround, you may adjust switch pattern (e.g. using glob-style matching) but you have to make sure it won't conflict with server's url.
hope this helps.