Redirect NON-www to www for https

前端 未结 2 1129
悲&欢浪女
悲&欢浪女 2020-12-21 17:11

I\'ve the following redirect

RewriteCond %{HTTP_HOST} !^www\\. 
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 
RewriteCond %{HTTPS} !on
RewriteRule         


        
2条回答
  •  再見小時候
    2020-12-21 17:14

    I'm using this on a Joomla site and it redirects everything to https://www I can't see this solution anywhere else so thought I'd share it

    RewriteCond %{HTTP_HOST} ^domainname\.co.uk [NC]
    RewriteRule ^(.*)$ https://www.domainname.co.uk/$1 [R=301,L]

提交回复
热议问题