I have a IIS 8.5 server, I installed wordpress on the server and use the URL Rewrite rule for File and directory for Wordpress and placed it at www.mysite.com/blog/. It worked. Now I have moved my blog to an independent server and wants to use rewrite module to reverse proxy for my blog from my new server with out changing the URL. I achieved it, the main page of blog shows usingwww.mysite.com/blog/. Now the problem is when I want to open any post from blog it give me 404 error and try to find the directory on the local as the directory does not exist. I have set my permalink in WP as postname. When I change the structure of peramlinks to any other pattern it works and doesn't give 404 error e.gwww.mysite.com/blog/testblog (this give error) but if I use any other likewww.mysite.com/2015/10/testblog (no error the post shows). Attache are my Rewrite rule.
<rewrite><outboundRules><rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1"><match filterByTags="A, Form, Img" pattern="^http(s)?://1.1.1.1/blog/?(.*)" /><action type="Rewrite" value="http{R:1}://demo.mysite.com/blog/{R:2}" /></rule><preConditions><preCondition name="ResponseIsHtml1"><add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /></preCondition></preConditions></outboundRules><rules><clear /><rule name="ReverseProxyInboundRule1" stopProcessing="true"><match url="/?blog/?(.*)" /><conditions logicalGrouping="MatchAll" trackAllCaptures="false"><add input="{CAHCE_URL}" pattern="^http(s)?" /></conditions><action type="Rewrite" url="http{C:1}://1.1.1.1/blog/{R:1}" logRewrittenUrl="true" /></rule></rules></rewrite>