Ad

No Css/js Or Images Found On Heroku Deployment Octobercms

I have deployed my octobercms site on heroku successfully but it is not loading any css/js or image file. All links go to 404. External links are loaded but no local link is working. I have deployed it using Github.

I have tried all of solutions I found anywhere on web but none of them works. All laravel solutions are not working. I can't even access any file manually. Functionality of site is working normally.

currently this is how links are included:

  <link type="text/css" target="_blank" rel="nofollow noreferrer" href="{{'assets/css/custom.css'| theme}}" rel="stylesheet">

and this is how they are shown when rendered:

<link type="text/css" target="_blank" rel="nofollow noreferrer" href="http://pandak-farms.herokuapp.com/themes/codejunkie/assets/css/custom.css" rel="stylesheet">

links should open but all of them are pointing to 404. demo: http://pandak-farms.herokuapp.com/themes/codejunkie/assets/css/argon.css?v=1.0.1

Ad

Answer

Finally found the answer. Just setting up an env variable fixes the mixed content issue. set LINK_POLICY to 'secure' either in the .env file or in the config/cms.php

Ad
source: stackoverflow.com
Ad