织梦网站apache服务器http301重定向到https, 并且不带www跳转到带www

用织梦做网站经常遇到需要http 301重定向到https,Apache环境下,.htaccess 伪静态让http 301重定向到https, 并且不带www跳转到带www方法

.htaccess

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

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

Powered By sitemap