Option to force URLs to return HTTPS instead of HTTP

Created on 11 January 2017, about 8 years ago
Updated 24 July 2024, 9 months ago

Problem

A problem has existed since #2528988: Remove the option to specify a base_url from within settings.php β†’ was committed - it is no longer possible to force all links from a site to appear as HTTPS instead of HTTP. This becomes a problem when e.g. using a load balancer, reverse proxy or CDN service that present a secure site to the public even though the web server itself might be loaded as HTTP, causing problems like πŸ“Œ urls with http instead of https Needs review .

Proposed solution

Add a global option via settings.php that would replace all URLs generated to use HTTPS paths.

✨ Feature request
Status

Closed: works as designed

Version

8.6 ⚰️

Component
BaseΒ  β†’

Last updated about 18 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom very_random_man

    For anyone coming across this as I did, you can force HTTPS by adding this to settings.php:

    $_SERVER['HTTPS'] = 'on';
    

    My use case was running D10 on AWS with an auto scaling group behind an Elastic Load Balancer and this fixed the issue where URLs were being rendered as `http://...`

Production build 0.71.5 2024