How to redirect to HTTPS with .htaccess on Heroku Cedar stack

前端 未结 3 1704
借酒劲吻你
借酒劲吻你 2020-12-05 10:39

I\'m new to cloud hosting...

I\'m working on a PHP web app that\'s hosted on Heroku as a \"Cedar\" app. Heroku offers \"piggy back\" SSL to all their subdomains, so

3条回答
  •  青春惊慌失措
    2020-12-05 11:11

    I added one line to the great answer given above so it doesn't break my local dev environment which doesn't have SSL configured:

    # If header is present in the request
    RewriteCond %{HTTP:X-Forwarded-Proto} .
    

    (Note RewriteRule is applied only if all preceeding RewriteCond's hold).

提交回复
热议问题