iis7 iis8反向代理规则编写!

目的:把A站当做B站二级目录

如:

http://www.baidu.com 等于 /baidu/

http://www.qq.com 等于 https://www.seo5g.com/qq/

 

1、安装64位 URL IIS7重写 rewrite

下载地址为:https://www.seo5g.com/gjxz/requestRouter_amd64.zip

2、安装requestRouter_amd64.msi

下载地址为:https://www.seo5g.com/gjxz/requestRouter_amd64.zip

 

3、以下为规则保存在记事本重命名为web.config。放网站根目录:

 

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="OrgPage" stopProcessing="true">
<match url="^baidu(.*)$" />
<action type="Rewrite" url="http://www.baidu.com/{R:1}" />
</rule>
<rule name="OrgPage4" stopProcessing="true">
<match url="^qq(.*)$" />
<action type="Rewrite" url="http://www.qq.com/{R:1}" />
</rule>
</rules>
</rewrite>

<defaultDocument>
<files>
<clear />
<add value="index.html" />
<add value="1.html" />
<add value="index.php" />
</files>
</defaultDocument>
</system.webServer>
</configuration>

4、找到aRR 如下图依次点击

 

 

 

代码说明:

<rule name="随意写必须不重名" stopProcessing="true">
<match url="^网站本地二级目录名(.*)$" />
<action type="Rewrite" url="被调用网站或者被调用网站二级目录名{R:1}" />
</rule>

大功告成啦

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: