Production paths are relative to docroot, not current folder
See original GitHub issueI did a yarn build
and then tried to serve the contents of the build folder with Apache webserver. I wanted to serve it from chatserver.example.com/admin
but that results in 404s when trying to load chatserver.example.com/static/js/main.78b12af2.chunk.js
which is no surprise… the files are in chatserver.example.com/admin/static/js/main.78b12af2.chunk.js
This would be solved if the path in the index.html
lacked the initial slash. Eg:
<script src="static/js/2.2e1c8a1a.chunk.js">
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Relative and absolute paths, in the file system and on the web ...
If the path is built starting from the current location, it is called relative (which makes sense, as it is relative to our...
Read more >Cannot make Relative Path, Rewrite Rules and Routes ...
I've updated my answer to better explain the document root and have provided a sample config for an apache virtualhost. This should get...
Read more >Paths explained: Absolute, relative, UNC, and URL—Help
Relative paths are relative to a current directory, which is the location of the saved document or toolbox.
Read more >Problems with using relative path names [#13148] | Drupal.org
Looking at my site's logs, there seem to be several problems that are caused by Drupal's use of relative path names. If Drupal...
Read more >Absolute and Relative Paths
A link that has a relative path will be written to tell the computer how to get from the folder with the currently...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Should be fixed with 1002b6464a1093b000ebf1d3e9b26cb04526ff11
See also https://github.com/facebook/create-react-app/issues/527
You can now do this with Docker Compose as well. See README.md and #266 .