0

I need to take requests to firstdomain.com/example/foo/bar and serve up content from seconddomain.com/example/foo/bar but I want the end user to still see firstdomain.com/example/foo/bar in their browser. That rules out a 301/302 redirect. I thought URL-rewrite would do the trick, but that has to be same domain. I think ARR is what I need. So, I've installed ARR v3.0 and rebooted my server. Now that ARR v3.0 is installed, how do I go about configuring it to perform the desired request routing?

I should note seconddomain.com is a 3rd party hosted server, whereas firstdomain.com is hosted on a server on our network.

0
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
        <rewrite>
            <rules>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://www.seconddomain.com/{R:1}" />
                </rule>  
            </rules>
            <outboundRules>
                <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
                    <match filterByTags="A, Form, Img" pattern="^http(s)?://www.seconddomain.com/(.*)" />
                    <action type="Rewrite" value="http{R:1}://www.firstdomain.com/{R:2}" />
                </rule>
                <preConditions>
                    <preCondition name="ResponseIsHtml1">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                </preConditions>
            </outboundRules>
        </rewrite>
    </system.webServer>
</configuration>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.