You can send your questions to my email to get faster answer in 24 hours (free).
Buy me a coffee

Replace PDF URL with a nice URL

By default, when opening a PDF file, it will open a long URL like this: https://static1.squarespace.com/static/644f2654b9c076768430cf4b/t/65af6a17e2c4821faedba955/1705994779057/book.pdf (this is just an example URL so it doesn’t exist, no need to click it)

We can use a trick to change it to something like this: yourdomain/pdf/book

#1. First, you need to get a PDF URL

#2. Create a Page with

  • Name: you can enter anything
  • URL: /pdf/book

replace-pdf-url-with-a-nice-url-01-min

#3. Use this code to Page Header Code Injection

Replace the PDF URL in the code with your PDF file URL.

<iframe src="https://static1.squarespace.com/static/644f2654b9c076768430cf4b/t/65af6a17e2c4821faedba955/1705994779057/book.pdf">
  
</iframe>
<style>
iframe {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  }
</style>

replace-pdf-url-with-a-nice-url-02-min

#4. Result

replace-pdf-url-with-a-nice-url-03-min

Ask me a question, free

If your site is private or in trial, just setup password and share url. See how to: https://beaverhero.com/squarespace-how-to/
Please check your email carefully. Recently I got a lot of questions with wrong emails.

If you haven't heard from me within 24 hours please check your junk/spam folder