Node js project public folder contents 404 error

I have a node js project that is hosted on A2 hosting and everything runs smoothly, but am now trying out inmotion and there I am experiencing an issue where none of my public folder contents are loading they are all returning 404 error. The html is loading fine.

image

If I manually prefix each resource with “/public/” then it seems to work, but shouldn’t need to do that, and also won’t work when I am using 2 shared hosting environments as per above.

I have tried changing “links relative to” from Site Root to Document, which fixes the bootstrap link, but images are unaffected, and readding the images makes no difference.

Could someone please provide some guidance as I think I am missing something obvious

I think this is a matter of setting the remote server to recognize the public folder as the document root folder.

In Plesk, this will look like

image

where app is the application root folder.

Talk to the Host to get more info.

Thank you ben, that was it. I never considered it since the home page worked fine so thought the doc root must have been correct. Guess I am missing some learnings

1 Like