regex - Is there a Lowercase rewrite rule that will still allow CamelCaps AJAX methods? -
on iis7 box, have url rewrite rule in web.config keeps of urls lowercase:
<rule name="lowercaserule1" stopprocessing="false"> <match url="^((?=.*[a-z]).*\.aspx)(.*)" ignorecase="false" /> <action type="redirect" url="{tolower:{r:1}}{r:2}" /> </rule> this has been working well, rewrites ajax webmethod calls when contain capitals letters. consequently methods don't called. obvious solution keep webmethods lowercase, way more appropriate attack on front rewrite's regex.
currently:
/default.aspx ==> /default.aspx
/default.aspx/updateorder ==> /default.aspx/updateorder
i'd latter example rewrite /default.aspx/updateorder
my regex skills can't me there.
thanks in advance, john
i set problem aside , came later. added negate condition , seems trick:
<rule name="lowercaserule1" stopprocessing="false"> <match url="^((?=.*[a-z]).*\.aspx)(.*)" ignorecase="false" /> <conditions logicalgrouping="matchall" trackallcaptures="false"> <add input="{http_url}" matchtype="pattern" pattern="^([^a-z]+\.aspx/)(.*)" ignorecase="false" negate="true" /> </conditions> <action type="redirect" url="{tolower:{r:1}}{r:2}" /> </rule>
Comments
Post a Comment