1

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

but

mymicrosite.com > Domain Redirect > mymainsite.com

I need

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?

1 Answer 1

1

Yes, you can use the URLRewrite module.

<match url=".*"/>
    <conditions>
        <add input="{HTTP_HOST}" pattern="mymicrosite.com" />
    </conditions>
</match>
<action type="Redirect" url="http://mymainsite.com/microsite-products/{R:1}" 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .