Today's task was to redirect all pages from an old domain to new domain except one page (google verification file). All pages including any query string should be stripped out and redirect to only homepage of new domain with out any query string.
Magento core provides some built-in redirect functions to redirect url to new urls. Let's check few of them below:
From any of your Magento controller you can redirect user to any url as defined below. If you want to use redirect function in your magento observer model check this Technooze_T404 extension which I created to handle 404 issue in multi-store magento installation as defined here - stackoverflow question.