Take redirects off the Host header.
Same-site redirects are now relative paths, and a saved page on another site is ignored. The HTTP to HTTPS redirect takes its host from the new SITE_URL setting, and without it the pages refuse plain HTTP.
This commit is contained in:
@@ -47,7 +47,8 @@ function xxx_page_route() {
|
||||
|
||||
if (!isset($_SERVER['HTTP_X_TEST_PLAIN']))
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
$_SERVER['SERVER_NAME'] = 'xxx.org.za';
|
||||
// Apache with UseCanonicalName Off also takes SERVER_NAME from the Host header
|
||||
$_SERVER['SERVER_NAME'] = preg_replace('/:\d+$/', '', $_SERVER['HTTP_HOST'] ?? '');
|
||||
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_TEST_ADDRESS'] ?? '192.0.2.1';
|
||||
$_SERVER['SCRIPT_FILENAME'] = $file;
|
||||
$_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = substr($file, strlen(XXX_ROOT));
|
||||
|
||||
@@ -3,6 +3,7 @@ DB_HOST=db.test
|
||||
DB_USER=test-user
|
||||
DB_PASS=test-pass
|
||||
DB_NAME=test-db
|
||||
SITE_URL=https://site.test
|
||||
RECAPTCHA_SITE_KEY=test-site-key
|
||||
RECAPTCHA_SECRET=test-secret
|
||||
GOOGLE_ANALYTICS_ID=
|
||||
|
||||
Reference in New Issue
Block a user