.htaccess redirect subfolder to HTTPS

前端 未结 7 1825
佛祖请我去吃肉
佛祖请我去吃肉 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:23

    This work for me, this allow you to redirect to https a specific folder, just add an htaccess file inside of the folder with the following content:

    RewriteCond %{HTTPS} off
    RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    

提交回复
热议问题