由网友(弓对弦月)分享简介:我已经正确启用HTTPS重定向与下面的code。访问HTTPS页面中的一个后,所有其他URL都继承了previous HTTPS。我怎么能强制所有其他页面的HTTP?#BEGIN字preSS< IfModule mod_rewrite.c>RewriteEngine叙述上的RewriteCond%{}...![301重定向怎么做](https://p.xsw88.cn/allimgs/daicuo/20230902/417.png)
我已经正确启用HTTPS重定向与下面的code。 访问HTTPS页面中的一个后,所有其他URL都继承了previous HTTPS。我怎么能强制所有其他页面的HTTP?
#BEGIN字preSS
< IfModule mod_rewrite.c>
RewriteEngine叙述上
的RewriteCond%{} HTTPS!上
的RewriteCond%{REQUEST_URI} ^(/结帐| /下载| /全部产品)
重写规则^(。*)$ https://websitename.com/$1 [R,L]
RewriteEngine叙述上
的RewriteBase /
重写规则^指数 .PHP $ - [L]
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则。的index.php [L]
< / IfModule>
#结束字preSS
解决方案
您可以使用:
#BEGIN字preSS
< IfModule mod_rewrite.c>
RewriteEngine叙述上
的RewriteBase /
的RewriteCond%{} HTTPS关闭
的RewriteCond%{REQUEST_URI} ^ /(结帐|下载|全产品)
重写规则^(。*)$ https://websitename.com/$1 [R = 301,L,NE]
的RewriteCond%{} HTTPS上
的RewriteCond%{REQUEST_URI} ^ /!(结帐|下载|全产品)
重写规则^(。*)$ http://websitename.com/$1 [R = 301,L,NE]
重写规则^指数 .PHP $ - [L]
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则。的index.php [L]
< / IfModule>
#结束字preSS
![301重定向怎么做](https://p.xsw88.cn/allimgs/daicuo/20230902/417.png)
I've correctly enabled HTTPS redirect with the code below. After visiting one of the HTTPS pages, all other urls are inheriting the previous HTTPS. How can I force all other pages to HTTP?
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} ^(/checkout|/downloads|/all-products)
RewriteRule ^(.*)$ https://websitename.com/$1 [R,L]
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
解决方案
You can use:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/(checkout|downloads|all-products)
RewriteRule ^(.*)$ https://websitename.com/$1 [R=301,L,NE]
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/(checkout|downloads|all-products)
RewriteRule ^(.*)$ http://websitename.com/$1 [R=301,L,NE]
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
相关推荐
最新文章