How to Upload an Ads.txt file to Root Directory of Squarespace
This post is a collaboration with BeyondSpace.studio
Uploading files to the root directory is essential for services like Google ads.txt verification,Squarespace doesn’t offer direct access to a traditional root directory, but with the use of URL redirects, you can mimic this functionality. This guide will show you how to upload an ads.txt file and make it accessible for ad verification.
Uploading Files on Squarespace
Squarespace doesn't support a traditional root directory; instead, uploaded files are stored on its dedicated CDNs. To achieve the effect of a root directory upload, you’ll need to use 301 redirects.
When ads.txt is uploaded to the root directory, it is accessible at top-level domain as such your-domain.com/ads.txt
Step-by-Step Guide to Uploading Ads.txt
Step 1: Download Your Ads.txt File
Get the ads.txt file from the verification service (e.g., Google AdSense).
Step 2: Upload the File via Link Manager
Go to your Pages in Squarespace.
Add a Link in the Main Navigation.
Choose File as the Link Type and upload your ads.txt file.
Exit the Squarespace Link Editor without saving since we’re only using it for uploading the file.
This will store the file in your Squarespace CDN and it will be accessible at /s/ads.txt, eg: your-domain.com/s/ads.txt
Pro tip: explore all the gateway to Squarespace Link Editor to upload and manage file in this post.
Step 3: Trace the File URL
Use a URL tracing tool like WhereGoes or Beyondspace Redirection tracer to get the real URL of the file. Paste your your-domain.com/s/ads.txt URL into the tool and trace it to its CDN source URL.
Step 4: Set Up a Redirect in URL Mappings
Go to Settings > Developer Tools > URL Mappings in your Squarespace dashboard.
Add the following redirect:
/ads.txt -> {real-file-path} 301
Replace {real-file-path} with the traced CDN URL.
Pro tip: If you used Beyondspace Redirection tracer to trace the redirection, simply copy the redirection in Root Directory Redirection after the trace completed.
Step 5: Verify the File
Complete the verification process for your external service by providing the redirected URL (e.g., https://your-domain.com/ads.txt).
How This Works
Using a 301 redirect makes the file accessible at the root directory, even though it is hosted on Squarespace’s CDN. Google supports such single redirect to external domain (this case, redirection from your domain to Squarespace static CDN) for ads.txt verification, making this method effective for those using Squarespace.
Supported Services
Google ads.txt verification
Conclusion
Squarespace doesn’t have a traditional root directory, but by using URL redirects, you can effectively upload verification files like ads.txt and meet the requirements of external services. This method works for all Squarespace plans, including the Personal plan.