Fixing Link References (non-absolute) after static export
Fixing Link References (non-absolute) after static export
At a glance
The community member is having trouble hosting a website created with WebStudio on their own web host. They exported a zip file from WebStudio, extracted the files, and uploaded them via FTP, but the links are broken. The only solution they've found is to manually update the links in each HTML file. The community members suggest using npx serve to test locally, but the community member says that didn't work either. The issue seems to be that WebStudio generates absolute links that don't work when the files are hosted in a non-root folder. The community members suggest that WebStudio should provide more flexibility for hosting the files in a non-root folder, either through relative URLs or by changing the expected folder structure.
Hey there, I'm not sure if this is the right question to be asking, I'm a bit out of my depth here. I am not using Vercel or Netlify, I have a web host already. My hope was that I could export a zip from WebStudio, then extract and upload that folder via FTP and everything would work. Unfortunately, due to the way the absolute links are generated, everything is broken once it gets there.
The only solution I've found is to manually go into each html file, and find and replace things like /assets/ to mywebsite.net/assets/. Is there an easier way of doing this that doesn't require a ton of finding and replacing? Thanks!
But, I also think it would be useful to consider export options that create some flexibility for the end user, either by way of relative urls or changing what folder Webstudio expects its files to live.