搜外网>搜外问答>问答页面

iis7虚拟主机如何实现全站301跳转到带www的网址

新建了一个网站,但是网站不能实现全站301跳转到带www的,主机是iis7的虚机,请问应该如何操作

www.23apk.cn

上面这个是网址

模板使用的是zblog的,下面是web.config规则,懂行的帮一下呗

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

<system.webServer>

<rewrite>

<rules>

<rule name="/ Z-BlogPHP Imported Rule" stopProcessing="true">

<match url="^.*?" ignoreCase="false" />

<conditions logicalGrouping="MatchAll">

<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />

<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />

</conditions>

<action type="Rewrite" url="index.php/{R:0}" />

</rule>

<rule name="/ Z-BlogPHP Imported Rule index.php" stopProcessing="true">

<match url="^index.php/.*?" ignoreCase="false" />

<conditions logicalGrouping="MatchAll">

<add input="{REQUEST_FILENAME}" matchType="IsFile" />

</conditions>

<action type="Rewrite" url="index.php/{R:0}" />

</rule>

    <rule name="301" stopProcessing="true">

     <match url="^(.*)$" ignoreCase="false" />

     <conditions>

      <add input="{HTTP_HOST}" pattern="^23apk.cn$" />

     </conditions>

     <action type="Redirect" redirectType="Permanent" url="http://www.23apk.cn/{R:1}"/>

    </rule>

</rules>

</rewrite>

</system.webServer>

</configuration>

追加问题
    2 人参与回答
武荣网络
武荣网络 · 提供网站建设(仿站)、美团点评运营、云服务器、小程序制作、网站优化(SEO)、竞价托管(SEM)、网络推广。☛☞

<p>IIS有URL重写功能,做301重定向 即可。</p>

建议你使用CDN加速,一般都有一键全站跳转的 比较方便

SEO培训招生中
188