ranaharoon yes indeed. Flarum only works when accessed from the exact same URL defined in config.php. (must be same domain and same protocol!)
Flarum does not handle redirects to that URL. Apache/nginx rewrites rules should be used, or there is also the Canonical URL extension available to take care of that.