Is it possible to redirect everything in a subdomain to the main domain.

Eg

anything.example.com

something.anything.example.com

must all go to example.com

and

anything.example.com/page.php

something.anything.example.com/page.php

must all go to example.com/page.php

is this possible ? on a shared host ?