Closed jcohlmeyer closed 7 years ago
What is your site url set to?
My site url is set to https://sustainable-development-goals.iisd.org/
I think ...
Below is my site/settings/settings.yaml
file:
license_key: ***
locales:
en:
full: en_US
name: English
url: https://sustainable-development-goals.iisd.org/
timezone: UTC
date_format: F jS, Y
default_extension: md
filesystems:
content:
driver: local
root: site/content
storage:
driver: local
root: site/storage
users:
driver: local
root: site/users
themes:
driver: local
root: site/themes
url: /site/themes
app_key: 3Oqal45ffRi3MmuQy92Y7zOnwHDIEtmS
redactor:
-
name: Standard
settings:
buttons:
- formatting
- bold
- italic
- unorderedlist
- orderedlist
- html
-
name: Basic
settings:
buttons:
- bold
- italic
csrf_exclude: [ ]
send_powered_by_header: true
ensure_unique_ids: true
I'm having the same issue (had it since v2 beta). It seems to have something to do with cookies/sessions, because after I clear those the website and control panel starts working again (no more redirect loop). My htaccess is more or less "default", only added the https/www redirect.
Looks like the issue is related to the cookie set header in the .htaccess file:
# ------------------------------------------------------------------------------
# Use https only for cookies
# ------------------------------------------------------------------------------
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
This above code is intended to help prevent XXS however it is breaking Statamic randomly when using the control panel over https.
Source: https://geekflare.com/httponly-secure-cookie-apache/
This usually just works out of the box, but we've found cases where the Symfony routing component doesn't properly detect your https headers, so we added an explicit setting for it. It'll be in the next release.
Expected behaviour
Control Panel to work with https
Actual behaviour
Randomly Statamic produces http links and creates a http redirect loop when using the Control Panel
Steps to reproduce
Server configuration
Operating system: CentOS
Web server: Apache
PHP version: 5
Statamic version: 2.1.18
Updated from an older Statamic or fresh install: 2.x -> 2.1.18
List of installed addons:
htaccess
If any logs (browser, server, or Statamic) are appropriate...