我们有一个网站 www.A.Com ,当我浏览网址 www.A.Com/loc 时
我需要重定向到由SEO提供商托管的子域 www.loc.A.Com 并显示由他们托管的页面。
主要要求是我们不应更改URL,即URL应保持 www.A.Com/loc
我们通过定义以下规则
尝试使用URL Write模块<rewrite>
<rules>
<rule name="ProxyExample" stopProcessing="true">
<match url="^locations/?(.*)" />
<action type="Rewrite" url="http://A.Locations.com/{R:1}" />
<serverVariables>
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
</rules>
</rewrite>
一个注意事项是我们的网站托管在Azure App Service上
答案 0 :(得分:0)
如果您要移除serverVariables
:
<rule name="ProxyExample" stopProcessing="true">
<match url="^locations/?(.*)" />
<action type="Rewrite" url="http://A.Locations.com/{R:1}" />
</rule>