muban大师 发表于 2020-3-1 10:05:42

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

用织梦做网站经常遇到需要http 301重定向到https,Apache环境下,.htaccess 伪静态让http 301重定向到https, 并且不带www跳转到带www方法
       
        .htaccess
       
        #开启伪静态
        RewriteEngine On
        #http 301重定向到https, 并且不带www跳转到带www
        RewriteCond %{HTTP_HOST} ^123.com [NC,
        RewriteRule ^(.*)$ https://www.123.com/$1 [L,R=301,
        RewriteCond %{SERVER_PORT} 80
        RewriteRule ^(.*)$ https://www.123.com/$1 [L,R=301,
       
        上面3处123.com改成你自己的域名即可
页: [1]
查看完整版本: 织梦网站apache服务器http301重定向到https, 并且不带www跳转到带www