相关疑难解决方法(0)

将网站从http重定向到https

我有一个存储在azure上的网站,我获得了SSL证书.我正在尝试将www.mywebsite.com重定向到https://www.mywebsite.com,但没有成功.

我使用以下代码来更改部署项目的IIS的配置:

<system.webServer>
<rewrite>
  <rules>
    <rule name="Redirect to HTTPS">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
        <add input="{URL}" pattern="/$" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
      </conditions>
      <action type="Redirect" url="https://{SERVER_NAME}/{R:1}" redirectType="SeeOther" />
    </rule>
  </rules>
</rewrite>
Run Code Online (Sandbox Code Playgroud)

但是当我输入我的URL时,它不会重定向到https.

顺便说一下,重写似乎没有被Intellisense重新识别.

c# iis azure

5
推荐指数
1
解决办法
967
查看次数

强制HTTPS用于特定URL

这应该是一个快速...这是我目前的.htaccess文件:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
Run Code Online (Sandbox Code Playgroud)

我需要做的是确保如果http://www.mydomain.com/cart/达到,它需要强制HTTPS ...... /cart/以及其中的任何内容/cart/

.htaccess ssl https redirect

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

.htaccess ×1

azure ×1

c# ×1

https ×1

iis ×1

redirect ×1

ssl ×1