我正尝试通过IIS7(Windows 7)上的“使用URL重写模块 ”来重写URL。
url: http://localhost/AIM/group-discussion/videos.aspx?id = 4&title =部分标题
重写URL: http:// localhost / AIM / group-discussion / videos / 4 / some-title
重写规则:
<rewrite> <rules> <rule name="RewriteUserFriendlyURL1" stopProcessing="true"> <match url="^AIM/group-discussion/videos/([^/]+)/([^/]+)/?$" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="AIM/group-discussion/videos.aspx?id={R:1}&title={R:2}" /> </rule> </rules> </rewrite>
访问重写URL( http:// localhost / AIM / group-discussion / videos / 4 / some-title )时出现404错误
通过IIS7中的“失败的请求跟踪”错误日志
MODULE_SET_RESPONSE_ERROR_STATUS ModuleName="IIS Web Core", Notification="MAP_REQUEST_HANDLER", HttpStatus="404", HttpReason="Not Found", HttpSubStatus="0", ErrorCode="The system cannot find the file specified. (0x80070002)", ConfigExceptionInfo=""
我在“ 集成pipe道模式”
尝试使用来自www.sysinternals.com的进程监视器。 这将让你知道它试图在磁盘上做什么。 可能你只需要在你的重写path的开头。
如果它不显示试图在磁盘上执行任何操作,请尝试“失败的请求跟踪”。 这将提供更多的细节。