getgrav / getgrav/grav-plugin-admin

Force SSL option can cause redirect loop

Open
#827 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
377
Forks
225
Avg merge
11h 51m
Merged PRs (30d)
4

Description

I am deploying to Heroku. After enabling the Force SSL option in the Grav Admin Plugin, the "/admin" page works correctly, but the default main "/" content page becomes stuck in a redirect loop. I suspect this has to do with the mechanism being used to detect whether SSL is being used, as Heroku uses SSL terminating load balancing (as far as I am aware).

When I added SSL redirection to my .htaccess manually to resolve this issue, I had to implement it as:

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

rather than what I might more typically do:

```
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
```

To be clear, this is a bug report, not a support request. I've resolved my immediate problem already.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.