Website Building » Squarespace » How Do I Redirect a Page to Another Page in Squarespace?

How Do I Redirect a Page to Another Page in Squarespace?

Last updated on October 1, 2022 @ 4:57 am

There are a few ways to redirect a page to another page in Squarespace. You can use an HTML redirect code, a server-side 301 redirect, or a JavaScript redirect.

An HTML redirect code is the simplest way to redirect a page. To do this, you just need to add a tag to the head of your page with the new URL you want to redirect to. For example, if you wanted to redirect http://example.com/page1.html to http://example.com/page2.html, you would add the following code to the head of page1.html:

This code tells the browser to immediately go to page2.html. You can also add a delay before the redirect by changing the 0 in the content attribute to a number of seconds.

For example, if you wanted there to be a 5 second delay before the browser redirected, you would change the content attribute to “5; url=http://example.html”.

You can also use a server-side 301 redirect. A 301 redirect is a permanent redirect that tells search engines that a page has moved permanently to a new location. To do this in Squarespace, you need to add a code snippet to your site’s .htaccess file. The .htaccess file is a configuration file for your server and is located in your site’s root directory (you may need to enable hidden files to view it).

To add a 301 redirect from page1.html to page2.html, you would add the following code snippet to your .htaccess file:

Redirect 301 /page1.html http://example.html

.htaccess files support many other directives besides Redirect, so make sure that this is the only Redirect directive in your file; otherwise, other directives may interfere with it.

PRO TIP: If you are considering redirecting a page on your Squarespace website, be sure to first consult with your web developer or designer. Redirecting a page can potentially break your website and cause problems with your site’s search engine optimization (SEO).

If you want more control over how and when users are redirected, you can use JavaScript instead of an HTML meta tag or .htaccess file.

To do this, you would add the following code snippet to the head of your page:

This code will cause the browser to redirected immediately when the page loads.

How Do I Redirect a Page Using HTML?


You can also add a delay before the browser is redirected by adding seconds after 0 like so:

This will cause there to be 5 seconds before being redirected.

How Do I Redirect Using JavaScript?

If you want more control over how and when users are redirected, you can use JavaScript instead of an HTML meta tag or .

To do this, simply put this line of code in the head tags of whatever webpage you want users redirected from:

<script type=”text/javascript”>window\.location=’http:\/\/www\.new-location\.com'<\/script>

Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.