Redirects

Managing Path Redirects

TailStatic allows you to create redirect rules for each of your sites. This is essential for maintaining SEO when you move or rename pages or change your site's structure.

Creating a Redirect Rule

A redirect rule consists of three parts:

  1. Source Path: The old URL path (e.g., /old-page).
  2. Target Path: The new URL path or a full external URL (e.g., /new-page or https://other-site.com).
  3. Status Code: Usually 301 (Permanent) or 302 (Temporary).

How Redirects Work

When a visitor requests a path on your site, TailStatic's internal router checks the redirect list before looking for a rendered file in the rendered site. If a match is found, the visitor is automatically sent to the target path.

Redirect Status Codes

  • 301 Moved Permanently: Tells search engines that the page has moved for good. This is a key part of managing SEO Files, Sitemaps, and OG Images.
  • 302 Found (Temporary): Tells search engines that the move is temporary. Use this for short-term promotions or maintenance.

Best Practices

  • Avoid Redirect Loops: Ensure that a redirect target does not point back to the source path.
  • Prefer Relative Paths: Use relative paths (like /contact) for internal redirects to keep them working even if you change your domain.
  • Clean Up Old Rules: Periodically review your redirect list and remove rules that are no longer needed.

Interaction with Routing

Redirects take priority over site content. If you have a file at /contact.html but also have a redirect from /contact to /about, the redirect will be followed.