.htaccess redirect subfolder to HTTPS

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

    Try This

    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteCond %{HTTPS} off
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
    

提交回复
热议问题