1

我在 azure 网站上有一个 wordpress 网站,传统上我使用快速重定向插件将一些页面重定向到新页面,但是这个插件在 windows 上不起作用,因为使用的是 web.config 文件而不是 .htaccess

当托管在 Windows 服务器中时,有任何方法可以从 wordpress 为某些页面生成 301 重定向,我已经搜索了一些插件来执行此操作,但没有找到任何插件。

更多细节:

Azure 网站使用 azurewebsites.net 的子域,例如 myblog.azurewebsites.net,我使用其他掩码域名配置网站 url 并且运行良好,但是,当用户浏览 myblog.azurewebsites.net/category/link 时,我想这样做重定向到 www .mydomain.com/blog/category/link 但在 web.config 中有 301 重定向。我正在尝试几种方法,包括位置和 url 重写,但没有任何效果。

使用的规则示例:

<rule name="CanonicalHostNameRule1" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAny">
        <add input="{HTTP_HOST}" pattern="subdomain\.azurewebsites\.net/([_0-9a-z-/]+)" />
    </conditions>
    <action type="Redirect" url="https://www.example.com/{R:1}" />
</rule>
4

1 回答 1

0

您是否使用Project Nami托管您的网站?

您的 wordpress 站点应该仍在使用 .htaccess,尽管我可能弄错了。

对于重定向,我使用Page Links To

于 2016-02-27T17:33:10.503 回答