Hi I have been trying to learn rewrite rule but still confused.

I am trying to make on where has a link to my maintenance page and i can turn it on and off when I want to.

Plus choose links/sub domains that can be made visible. while on maintenance mode.

If any one can point me in the write direction will be great thanks.