Quantcast
Channel: URL Rewrite Module
Viewing all articles
Browse latest Browse all 2482

Rewrite Rule to redirect frm domain other than one page

$
0
0

I am new to Rewrite module . Any quick reply will be helpfull

I need to write rule for following condition and want to maintain protocol as it is.  

1) B.mydomain.com/one.html - dont do anything

2) B.mydomain.com/otherthanone.html (anything other than one.html), redirect to X.mydomain.com

i m also new to "logicalGrouping" if it will use to apply "AND" relationship between condition or not.

I tired following but it is not working to avoid one.html, it redirect all request of  B.mydomain.com to X.mydomain.com


<rule name="RedirectBRule" enabled="true" stopProcessing="true">
<match url="(.*)" />

<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^B\.mydomain\.com$" />
<add input="{REQUEST_URI}" negate="true" pattern="^(b.mydomain.com/one.html)$" />
</conditions>
<action type="Redirect" url="{MapProtocol:{HTTPS}}://X.mydomain.com/" logRewrittenUrl="true" appendQueryString="false" redirectType="Permanent" />
</rule>
<rewriteMap name="MapProtocol">
<add key="on" value="https" />
<add key="off" value="http" />
</rewriteMap>


Viewing all articles
Browse latest Browse all 2482


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>