luke
March 17, 2021, 11:45pm
#21
Hi, @brianjychan . The redirect rule you posted wouldn’t make that change.
The issue has to do with how the assets are referenced in the HTML. For example:
href="/manifest.json"
That will always load manifest.json
from the site root.
However, if the reference one of these below instead:
href="manifest.json"
or:
href="./manifest.json"
Then the URL used for the HTTP request will be relative to the current path.
Would you please send us a link to the site? If so, we will be happy to see if that is the issue or not.
I found the issue! In my package.json
, I had marked homepage as "./"
, so changing it to "/"
removed the error. Thanks @luke your point tipped me off to it.
2 Likes
Thanks! This works just fine
1 Like
Thank you for this. This worked like a charm.
2 Likes
jossif
November 21, 2021, 8:08pm
#25
Amazing! This worked for me as well when I was trying to redirect via react-select or directly typing a path into my browser
Thank you so much!!
With this answer, I solve my problem in 3 min.
Keep going!
Regards
Jonas
1 Like
hillary
January 19, 2022, 9:16pm
#27
Glad this got you on the right path! Happy building
coelmay
Split this topic
January 23, 2022, 9:20am
#28
Just wanted to chime in and say thanks!! This worked for me too!
This was the key to my resolution. My build script was setting my homepage to ./ and changing it to / (as well as creating a _redirects file as described above) fixed it. Thank you!
1 Like
hillary
October 11, 2022, 2:54pm
#31
Thanks for coming back and letting us know! I am glad that this got you on the right track. Happy building
For me too! simple solution!
1 Like
Sualeh
December 5, 2022, 3:02pm
#33
Hey jaylowe1
You just saved a drowning man by giving a straw , was facing same issue but now it’s working fine .
Thank You So Much
SamO
December 6, 2022, 6:18pm
#34
Hello @noberto.filho and @Sualeh ! I am glad to hear our solution was able to get your back on track. We really appreciate your feedback.