对于IIS mod_rewrite,我需要以下内容
http://www.example.com
重定向到https://www.example.com
example.com
至https://www.example.com
www.example.com
至https://www.example.com
我正在使用这个www.sitename.com
至sitename.com
的那个不起作用-出现404错误:
<rewrite>
<rules>
<clear />
<rule name="Force WWW and SSL" enabled="true" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^[^www]" />
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="sitename.com{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
答案 0 :(得分:0)
这应该将http移至https,只需将下面的代码添加到您的e.x.
{your OpenCV path}\opencv\build\java\x64
or
{your OpenCV path}\opencv\build\java\x86
web.config
对于apache用户,只需将下面的代码添加到<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
文件中
.htaccess