gpt4 book ai didi

.htaccess 重定向 http ://with and without www and https://www to https://non-www

转载 作者:行者123 更新时间:2023-12-03 04:28:30 26 4
gpt4 key购买 nike

我希望重定向所有内容:

http://
http://www.
https://www.

to https://

这可能已经在这里得到了回答,但是在浏览了看起来相关的问题后,它们都不完全是我想要的,并且我尝试过的所有内容都导致了重定向循环或无法按预期工作。

例如:

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www.example.com
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

RewriteCond %{HTTPS_HOST} ^example.com
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

预先感谢您的帮助。

最佳答案

尝试:

RewriteCond %{HTTP_HOST} !^energenie4u\.co\.uk$ [NC,OR]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://energenie4u.co.uk/$1 [R=301,L]

关于.htaccess 重定向 http ://with and without www and https://www to https://non-www,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12687599/

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