Hi there,
I just started with rewrite for:
PublicWebsite > InternalSite > hosts Smartermail.
So far I got it working up to the point where there post requests, that have not rewritten addresses.
<rule name="To SmarterMail" enabled="true" stopProcessing="true"><match url="^smartermail/(.*)" negate="false" /><conditions logicalGrouping="MatchAll" trackAllCaptures="false"><add input="{CACHE_URL}" pattern="^(https?)://" /></conditions><serverVariables><set name="HTTP_ACCEPT_ENCODING" value="" /><set name="ORIGINAL_URL" value="{SERVER_NAME}" /></serverVariables><action type="Rewrite" url="{C:1}://internalMail/{R:1}" logRewrittenUrl="true" /></rule>
<outboundRules><clear /><rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1" enabled="true"><match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="http(s)?://internalMail/(.*)" /><conditions logicalGrouping="MatchAll" trackAllCaptures="true" /><action type="Rewrite" value="/smartermail/{R:2}" /></rule><rule name="RewriteRelativePaths" preCondition="ResponseIsHtml1" enabled="true"><match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^/(.*)" negate="false" /><conditions logicalGrouping="MatchAll" trackAllCaptures="true"><add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /><add input="{REQUEST_URI}" pattern="^/smartermail/(.*)" /></conditions><action type="Rewrite" value="/smartermail/{R:1}" /></rule><rule name="RewriteReletivePaths2" preCondition="ResponseIsHtml1" enabled="true"><match filterByTags="Script" pattern="^Services/(.*)" /><conditions logicalGrouping="MatchAll" trackAllCaptures="true"><add input="{RESPONSE_CONTENT_TYPE}" pattern="text/html" /><add input="{REQUEST_URI}" pattern="^/smartermail/(.*)" /></conditions><action type="Rewrite" value="/smartermail/{R:0}" /></rule><rule name="Rewite Location Header" preCondition="IsRedirection" enabled="true"><match serverVariable="RESPONSE_Location" pattern="^/(.*)" /><conditions logicalGrouping="MatchAll" trackAllCaptures="true"><add input="{ORIGINAL_URL}" pattern=".+" /><add input="{URL}" pattern="(smartermail)/.*" /></conditions><action type="Rewrite" value="http://{ORIGINAL_URL}:{SERVER_PORT}/{C:1}/{R:1}" /></rule><preConditions><preCondition name="ResponseIsHtml1"><add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /></preCondition><preCondition name="IsRedirection"><add input="{RESPONSE_STATUS}" pattern="3\d\d" /></preCondition></preConditions></outboundRules>
Sorry for part of the rules being experimental. There seen to parts of scripted code, that use relative address that are not rewritten.
Did someone succeed in rewriting SmarterMail? Or suggest some rule improvements? Any help is appreciated.
Thank BP