为什么有的url 的路径可以随意填写,iis后台返回匹配最短、匹配成功的文件,怎么做到的?(进来有详细)

jerryleeee 2019-03-19 05:31:05
比如这里 :

正常的url访问是这样:
http://www.hlj.gov.cn/zwfb/system/2019/03/01/010894619.shtml

但是如下也可以,而且后面随便添加,iis 里面怎么配置成这样?
http://www.hlj.gov.cn/zwfb/system/2019/03/01/010894619.shtml/test111111111111111111111111/test.html


求解!
...全文
90 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
jerryleeee 2019-03-20
  • 打赏
  • 举报
回复
应该就是 处理映射程序 添加模块映射 请求路径 *.html 模块选择 ServerSideIncludeModule,名称填写:SSINC-html 添加这个以后,就会出现上诉问题;
jerryleeee 2019-03-20
  • 打赏
  • 举报
回复
跟 其目录下的web.config 好像有关系

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>
            <add name="SSINC-html" path="*.html" verb="*" modules="ServerSideIncludeModule" resourceType="Unspecified" />
        </handlers>
    </system.webServer>
</configuration>

jerryleeee 2019-03-19
  • 打赏
  • 举报
回复
跟iis 配置这几段有关系么?

 <add name="Profile" type="System.Web.Profile.ProfileModule" preCondition="managedHandler" />
                <add name="UrlMappingsModule" type="System.Web.UrlMappingsModule" preCondition="managedHandler" />
                <add name="ApplicationInitializationModule" lockItem="true" />
                <add name="WebSocketModule" lockItem="true" />
                <add name="ConfigurationValidationModule" lockItem="true" />
                <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="managedHandler,runtimeVersionv4.0" />
                <add name="ScriptModule-4.0" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" />
                <add name="IISModule" preCondition="bitness32" />
                <add name="IISModule64" preCondition="bitness64" />

8,327

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 IIS
社区管理员
  • IIS
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧