I need to redirect an entire microsite (mymicrosite.com) to relevant pages on my main site (mysite.com).
My main site has a custom 301 module (built into the 404 page) which checks unfound paths against a list of paths where we've moved a page. So if I simply redirect the entire of my microsite at domain level I can handle all the paths from it in the 301 module.
But: I want the index page for my microsite to map to mymainsite.com/section1, instead of to the domain itself.
So mymicrosite.com/product1 > Domain redirect > mymainsite.com/product1 > 404 > 301 Module > mymainsite.com/microsite-product-1
mymicrosite.com > Domain Redirect > mymainsite.com
mymicrosite.com > Domain Redirect > mymainsite.com/microsite-products
Can this be done with URL rewrite, and if so, what would the regex look like that would rewrite a domain for all URLs with a domain/path structure but add a path if the URL to redirect contained ONLY the domain?