<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} !^on$ [NC] RewriteCond %{HTTP_HOST} ^(www.)?abc.com$ [NC] # 将abc.com和www.abc.com跳转到https://www.abc.com,防止apache子站继承上级目录.htaccess受影响 RewriteRule ^(.*)$ https://www.abc.com/$1 [R=301,L] </IfModule>
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP:From-Https} !^on$ [NC] RewriteCond %{HTTP_HOST} ^(www.)?abc.com$ [NC] # 将abc.com和www.abc.com跳转到https://www.abc.com,防止apache子站继承上级目录.htaccess受影响 RewriteRule ^(.*)$ https://www.abc.com/$1 [R=301,L] </IfModule>
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP:From-Https} !^on$ [NC] RewriteCond %{HTTP_HOST} ^(www.)?abc.com$ [NC] # 将abc.com和www.abc.com跳转到https://www.abc.com,防止apache子站继承上级目录.htaccess受影响 RewriteRule ^(.*)$ https://www.abc.com/$1 [R=301,L] </IfModule>
server { listen 80; server_name abc.com; rewrite ^(.*) https://www.abc.com$1 permanent; # abc.com对应修改为您自已的域名 }
if ( $http_from_https != 'on' ){ rewrite ^(.*) https://www.abc.com$1 permanent; # abc.com对应修改为您自已的域名 }
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="301" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{HTTP_FROM_HTTPS}" pattern="^on$" negate="true" /> </conditions> <action type="Redirect" url="https://www.abc.com/{R:1}" redirectType="Permanent" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="301" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{HTTPS}" pattern="^on$" negate="true" /> </conditions> <action type="Redirect" url="https://www.abc.com/{R:1}" redirectType="Permanent" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="301" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{HTTP_FROM_HTTPS}" pattern="^on$" negate="true" /> </conditions> <action type="Redirect" url="https://www.abc.com/{R:1}" redirectType="Permanent" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
RewriteEngine On RewriteCond %{HTTP:From-Https} !^on$ [NC] #RewriteCond %{HTTPS} !^on$ [NC] # 非亚数机房用这一行替换上一行规则 RewriteRule ^(.*)$ https://www.abc.com/$1 [R=301,L] # www.abc.com对应修改为您自已的域名 RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ https://www.abc.com$1 [R=301,L] # www.abc.com对应修改为您自已的域名
<security-constraint> <!-- Authorization setting for SSL --> <web-resource-collection > <web-resource-name >SSL</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>
站点统计
留言咨询