0π
S1. Open .htaccess file and add the following line Header always set Content-Security-Policy "upgrade-insecure-requests;"
S2. remove these lines from your htaccess:
RewriteCond %{SERVER_PORT} ^443$
RewriteRule (.*) http://www.example.com/$1
Please note that 443 port number is used for HTTPS requests.
0π
As you are deploying to Heroku, you are probably behind a proxy.
So you have to set Trusted Proxies. (See doc at https://laravel.com/docs/9.x/requests#configuring-trusted-proxies)
You can open the file /app/Http/Middleware/TrustProxies.php and then enable all ip if you donβt know the proxy IP.
/**
* The trusted proxies for this application.
*
* @var array<int, string>|string|null
*/
protected $proxies = '*';
Source:stackexchange.com