IIS Web如何把 url 中的目录名重写为变量

cycg5696 2016-12-25 04:41:03
例如:http://www.baidu.com/zhidao/ 重写为:
http://www.baidu.com/pindao/index.asp?q=zhidao

我写的 web.config是:

<rule name="gomghuo" stopProcessing="true">
<match url="^[\\/]?$" />
<conditions>
<add input="{HTTP_HOST}" pattern="(\w+)\.baidu\.com" />
</conditions>
<action type="Rewrite" url="/pindao/index.asp?q={C:2}" />
</rule>


提示:HT TP 错误 404.0 - Not Found
您要找的资源已被删除、已更名或暂时不可用。

详细错误信息模块 IIS Web Core
通知 MapRequest Handler
处理程序 Static File
错误代码 0x80070002

请求的 URL http://www.baidu.net:80/zhidao/
物理路径 G:\webs\zhidao\
...全文
878 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cycg5696 2016-12-26
  • 打赏
  • 举报
回复
版主 看看:有没有办法?
业余草 2016-12-26
  • 打赏
  • 举报
回复

8,327

社区成员

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

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