How to host a Squarespace export on Amazon S3
To host a Squarespace export on Amazon S3, create a bucket with static website hosting, make it public, and run aws s3 sync ./exported-site s3://my-bucket --delete. Add CloudFront for HTTPS. For hundreds of dated blog URLs, create one redirect object per old path, because routing rules stop at 50.
Last reviewed
Key facts
- Squarespace’s own export is an XML file for WordPress, not a folder of site files.
- An S3 object with x-amz-website-redirect-location answers with a 301 on the website endpoint.
- The REST endpoint ignores that metadata, so test on the website URL.
- Routing rules top out at 50 per bucket.
What a Squarespace export brings to Amazon S3
WebExport saves the public Squarespace pages, template styles, gallery scripts and images. S3 stores them as ordinary objects. A brochure or portfolio site goes up with one sync command, and the work that remains is almost all redirects.
A blog with several years of posts can have hundreds of dated paths. Fifty routing rules will not cover them, but S3 has a second tool. You can create a tiny object at each old key and give it a redirect target in its metadata, and the website endpoint answers each one with a 301.
Create the bucket and sync the folder
- Create a bucket and turn on static website hosting with index.html as the index document and 404.html as the error document.
- Turn off Block Public Access for that bucket and attach a bucket policy that allows s3:GetObject for everyone.
- Upload the folder with the AWS CLI, using --delete so removed pages disappear from the bucket.
- Put CloudFront in front of the website endpoint for HTTPS and your own domain.
aws s3 sync ./exported-site s3://my-bucket --deleteRedirects, headers and 404s on Amazon S3
The S3 website endpoint is HTTP only and has no header configuration, so security headers and HTTPS come from CloudFront. An S3 error document covers 4XX responses, and routing rules are limited to 50 per website configuration. For single pages you can set the x-amz-website-redirect-location metadata on an object, and the website endpoint answers it with a 301. Index documents work at every folder level on the website endpoint, but not through the REST endpoint.
This loop reads a CSV of old and new paths and creates one redirect object per line. Run it once after the sync.
# redirects.csv: old key,new path e.g. blog/2021/4/9/spring-launch,/blog/spring-launch
while IFS=, read -r old new; do
aws s3api put-object --bucket my-bucket --key "$old" \
--website-redirect-location "$new" --content-type text/html
done < redirects.csvThe key has no leading slash and no extension, matching the old URL. The target can be a path in the same bucket or a full URL. Run the sync first and the redirect script second. A later sync with --delete would remove these objects, so add an --exclude filter for the redirect keys if you sync again.
Squarespace output that needs fixing on Amazon S3
| In the Squarespace output | What to do on any static host |
|---|---|
| Images from squarespace-cdn.com and static1.squarespace.com | Open a page offline and watch the network tab. Any request to those hosts means a path was missed. |
| Features that fetch data from the live site | Load-more buttons, search and some blog listings ask the Squarespace server for data. Test each one on the static copy. |
| Form, newsletter and commerce blocks | These post to Squarespace. Replace the form targets and send shoppers to a hosted checkout. |
| Blog category and tag views | They are generated on request. Only URLs that appear in the sitemap or in page links are saved. |
Squarespace form and newsletter blocks post to Squarespace, and S3 has nothing to receive them. Replace them with a hosted endpoint. Look for features that fetch data from the live site, such as load-more and search, and test them with the network tab open. Send shoppers to a store you run elsewhere, since commerce blocks cannot run from a bucket.
Forms and dynamic features
S3 serves files and nothing else. Use a form service, or send the form to an API Gateway endpoint backed by a function you write.
A form service gives you an https endpoint for the action attribute. If you prefer your own, an API Gateway route that calls a function can email the submission. S3 on its own cannot.
What can go wrong
- Running sync --delete after creating redirect objects removes them, and the old URLs 404 again.
- Redirect objects only work on the website endpoint, so a CloudFront origin pointed at the REST endpoint will not redirect.
- Dropping the old site before the new one answers on your domain leaves visitors with errors.
Frequently asked questions
How do I redirect many old Squarespace URLs on S3?
Create one object per old key with the website redirect location metadata set to the new path. The website endpoint returns a 301 for each.
Does S3 handle Squarespace blog category pages?
Only the URLs that appear in your sitemap or page links are saved by the export, so category views generated on request may be missing. Link to a blog index instead.
Is S3 cheaper than Squarespace?
It depends on your traffic and storage. The Static Site Hosting Cost Calculator compares options with your own numbers, so use that instead of a general rule.
Can I keep the Squarespace domain?
Yes, keep the registration and point its DNS at CloudFront, once the distribution has your certificate. Check Squarespace’s domain settings for the DNS steps.
Official documentation
Free tools for this job
- Squarespace Exit PlannerStep-by-step guide and checklist generator for leaving Squarespace.
- No-Code Lock-in ScoreAnalyze any platform and get a portability score with data export options.
- Static Hosting PickerAnswer 5 questions and get the best hosting recommendation for your exported site.
- Static Site Hosting Cost CalculatorCompare hosting costs: Webflow vs Vercel vs Netlify vs Cloudflare Pages at scale.
Get the Squarespace files first
Paste your public Squarespace URL into the export form and download a ZIP you can deploy to Amazon S3. The Free plan covers 1 site, 5 exports a month, 15 pages and 20 MB per export. Professional is a $9.99 one-time purchase with unlimited pages.