0

我在 IIS 7.5 中安装了 PHP,它运行良好。我尝试使用的应用程序需要重写规则。我已经从 .htaccess 文件中导入了规则,只要协议是 http,重写就可以正常工作。如果使用 https,则以下规则失败。我并没有像大多数帖子似乎解释的那样尝试重定向到 https,我试图通过以下规则来支持 https...

            <rule name="Imported Rule 3" stopProcessing="true">
                <match url="^([^/\.]+)/?$" ignoreCase="false" />
                <action type="Rewrite" url="index.php?page={R:1}" appendQueryString="true" />
            </rule>
            <rule name="Imported Rule 4" stopProcessing="true">
                <match url="^([^/\.]+)/([^/]+)/?$" ignoreCase="false" />
                <action type="Rewrite" url="index.php?page={R:1}&amp;id={R:2}" appendQueryString="true" />
            </rule>
            <rule name="Imported Rule 5" stopProcessing="true">
                <match url="^([^/\.]+)/([^/]+)/([^/]+)/?" ignoreCase="false" />
                <action type="Rewrite" url="index.php?page={R:1}&amp;id={R:2}&amp;subpage={R:3}" appendQueryString="true" />
            </rule>     

如果我得到像http://myserver/search上述规则这样的 URL,那就太好了!如果我转到https://myserver/search页面响应 HTTP 错误 404.0 - 未找到。

想法?

谢谢!

4

0 回答 0