CodeIgniter Forums
Assets won't load if base url contains port number - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Assets won't load if base url contains port number (/showthread.php?tid=76421)



Assets won't load if base url contains port number - firdausai - 05-11-2020

I am running php spark serve to run a codeigniter 4 app locally.

if my $base_url have a port number, all my assets wont load, but it will if i remove the port number

This wont load my assets

Code:
public $baseURL = 'http://localhost:8080/folder_name';

This will load my assets

Code:
public $baseURL = 'http://localhost/folder_name';
Any suggestion as to why and how to fix it?

p.s I already change the base url in .env aswell to http://localhost:8080