Problem loading assets in a prefixed application #42639
Unanswered
lucraraujo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have an application that must be in a subdirectory.
Since I have so many problems trying to configure a web server (nginx, apache) to serve from a subdirectory the team decided to serve the aplication from the server root and prefix the aplication.
The problem is that no asset is being loaded since the asset hit the prefix and Laravel return a 404.
Example:
My application URL is http://example.com/foo. So all my routes starts with "foo".
When I open the application (go to example.com/foo), it tries to load the app.js which is at "https://example.com/foo/js/app.js" and I get a 404.
Right now I'm using apache and Laravel Mix and I'm loading the assets like this:
I also tested like this:
And my .env looks something like this:
webpack.mix.js
Beta Was this translation helpful? Give feedback.
All reactions