gpt4 book ai didi

WordPress 多站点 SSL htaccess

转载 作者:太空宇宙 更新时间:2023-11-03 13:22:27 25 4
gpt4 key购买 nike

我想在我的网站和子域上从非 https 重定向到 https,但我有问题需要解决。

这是我的设置:

www.domain.de
www.sub.domain.de
www.sub2.domain.de
www.sub3.domain.de

我可以通过 https 打开所有链接并且它有效,但由于重复内容我只想使用 https。

RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^(.*)$ https://domain.de/$1 [R=301,L]

到目前为止,这是我的 htaccess...但它将子域重定向到主域 :(

有什么想法吗?

最佳答案

您可以使用:

RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]

关于WordPress 多站点 SSL htaccess,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46006191/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com