Redirect to HTTPS with .htaccess with a specific domain

前端 未结 4 634

I currently have 2 domains that access to the same folder on my server: metrikstudios.com and ziced.com.

I want the users that enter through http://

4条回答
  •  鱼传尺愫
    2020-12-15 22:13

    You could simply add another RewriteCond to check if the host is metrikstudios.com

    RewriteCond %{HTTP_HOST} ^metrikstudios\.com [NC]
    

    and it should look like this:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^metrikstudios\.com [NC]
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
    

提交回复
热议问题