Join the Webstudio community

Updated 3 months ago

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.

Useful resources
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!
O
S
26 comments
SSG still requires a some webserver to host the files, can't just open it up locally from the file system without one
npx serve is recommended for locally testing
I assume you tested locally and it didn't work
Thanks Oleg, but no, as stated in the original post, I uploaded to my web server, and the links did not work.
you did something wrong, they should work
you can try it in that folder locally with npx serve .
I'm using Bluehost. My process was to export as "Vanilla", extract the files and upload them via FTP.
I haven't used bluehost, I assume they have a static file hosting that works the same way as every other
all static files are missing
Attachment
image.png
But yet, they are there
Is it possible that WebStudio simply doesn't like that I've put all the files in a subfolder
if you changed the structure then obviously its gonna be broken
Why does webstudio assume that I'm going to be hosting my files from the root folder
there are downsides to relative paths as well
it uses absolute
ideally you would just tell your webserver which folder to use
How do you mean
I can't tell for your hosting. Normally you have an option to decide where your root is
That's not the issue though, I have no intention of changing my root folder
I just want to host my webstudio files in a non-root folder
I do appreciate your help in isolating the issue, the answer is that webstudio expects to be run from the root folder.
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.
Add a reply
Sign up and join the conversation on Discord