JSu*_*nny 6 wordpress rewrite web-config multiple-domains azure
我有三个领域domain1.com
,domain2.com
并domain3.com
全部重新指向我的天蓝色的web应用程序mysites.azurewebsite.net
.在蔚蓝的网站三个文件夹可我的根文件夹domain1
,domain2
并domain3
用wordpress
安装在这些文件夹.目前我在我的下面给出了以下设置web.config
,它指向相应的文件夹.
<rule name="domain1" stopProcessing="true">
<match url=".*"/>
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^(www.)?domain1.com"/>
</conditions>
<action type="Rewrite" redirectType="Permanent" url="\domain1\{R:0}" />
</rule>
<rule name="domain2" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(www.)?domain2.com" />
<add input="{PATH_INFO}" pattern="^/domain2/" negate="true" />
</conditions>
<action type="Rewrite" url="\domain2\{R:0}" />
</rule>
<rule name="domain3" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(www.)?domain3.com" />
<add input="{PATH_INFO}" pattern="^/domain3/" negate="true" />
</conditions>
<action type="Rewrite" url="\domain3\{R:0}" />
</rule>
Run Code Online (Sandbox Code Playgroud)
我面临的问题是,当我点击任何子页面链接时,它将显示以下错误
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Run Code Online (Sandbox Code Playgroud)
当我从我的wordpress管理员禁用用户友好的URL(永久链接),然后它工作正常.但它显示mydomain.com/?page_id=1
为关于我们页面.
如何在永久链接更改为用户友好的URL之后使其工作 mydomain1.com/about-us
不工作,因为每个子文件夹都有wordpress和wordpress我启用了固定链接.否则它工作正常
小智 3
我没有完整的答案给你,但是每个规则上的 stopProcessing="true" 可能会给你带来一些悲伤,因为它会阻止规则被进一步处理,所以当你设置时,你的第二个和第三个规则将被忽略该标志位于第一条规则上。
您还可以将模式设置为在所有三个规则上匹配“*\”,因此也许这样的规则可以工作:
<rules>
<rule name="Domain2">
<match url="*.domain2.*" />
<conditions>
<add input="{UrlDecode:{QUERY_STRING}}" pattern="domain2" />
</conditions>
<action type="Rewrite" url="{HTTP_HOST}/domain2/" />
</rule>
</rules>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
164 次 |
最近记录: |