Oh my god ! finally got the solution.
<rewrite>
<rules>
<rule name="RedirectToWWW" stopProcessing="true">
<match url="^(.+)$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" url="page.aspx?n={R:0}"/>
</rule>
</rules>
</rewrite>
How do rewrite the url in web.config file(iis 7.5)?
-
02-06-2023 - |
문제
input : domainname.com/name
output : domainname.com/page.aspx?n=name
I have tried the below code.
<rewrite>
<rules>
<rule name="RedirectToWWW" stopProcessing="true">
<match url=".*" ignoreCase="true" />
<conditions>
<add input="{HTTP_HOST}" pattern="^domain.com$" />
</conditions>
<action type="Redirect" url="page.aspx?n={R:0}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
It works cool. But if I enter the domain name only, that also rewrite.how to avoid this problem?
올바른 솔루션이 없습니다
다른 팁
제휴하지 않습니다 StackOverflow