.htaccess redirect subfolder to HTTPS

前端 未结 7 1764
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 01:41

I\'m trying to write a RewriteRule for my .htaccess file. Specifically, whenever a user accesses a specific subdirectory, I would like it to Rewrite to force an HTTPS connec

7条回答
  •  醉梦人生
    2020-12-14 02:27

    I would put this into the domain's root directory:

    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(subdirectory/.*)$ https://www.mydomain.com/$1 [R=301,L]
    

提交回复
热议问题