美文网首页
301重定向到https 并且不带www跳转到带www

301重定向到https 并且不带www跳转到带www

作者: 清风籁籁的学习笔记 | 来源:发表于2021-06-14 03:36 被阅读0次

Apache环境下,.htaccess 伪静态让http 301重定向到https, 并且不带www跳转到带www

.htaccess

#开启伪静态 RewriteEngine On #http 301重定向到https, 并且不带www跳转到带www RewriteCond %{HTTP_HOST} ^cnlsx.com [NC] RewriteRule ^(.*)$ https://www.cnlsx.com/$1 [L,R=301] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.cnlsx.com/$1 [L,R=301]

上面3处cnlsx.com改成你自己的域名即可

相关文章

网友评论

      本文标题:301重定向到https 并且不带www跳转到带www

      本文链接:https://www.haomeiwen.com/subject/hcdnsltx.html