IIS7重写规则HTTPS

时间:2012-12-14 20:56:55

标签: iis-7 url-rewriting

我已经在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之类的网址,则上述规则效果很好!如果我转到https://myserver/search,页面会响应HTTP错误404.0 - 未找到。

思想?

谢谢!

0 个答案:

没有答案