IIS设置

步骤:IIS-->URL重写-->导入规则-->将伪静态代码填入重写规则-->点击应用

伪静态代码

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [L]
    </IfModule>

Typecho后台设置

步骤:后台-设置-永久链接-启用地址重写

如果提示启用失败,勾选仍然启用

宝塔面板

在宝塔面板-网站设置-重定向规则中写入下列代码

        <rule name="typecho_rewrite" stopProcessing="true">
        <match url="^(.*)$" ignoreCase="false"/>
        <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true"/>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true"/>
        </conditions>
        <action type="Rewrite" url="index.php/{R:1}"/>
        </rule>
最后修改:2022 年 10 月 02 日