Abstract27

How to Set Up Redirects in Ghost CMS

Ayoub OUARAIN6 min read
On this page

Introduction

Have you ever needed to change a page's URL, but worried about the negative impact it might have on your search ranking?

Redirects in Ghost CMS solve that problem with ease.

Redirects are essential for maintaining the integrity of your website.

They send users and search engines from an old URL to a new one, making sure your SEO isn't affected and the user experience stays smooth.

Without proper redirects, visitors could run into 404 errors, hurting both their browsing and your SEO ranking.

Ghost CMS is a modern publishing platform, well known for its simplicity and performance.

One of its key features is redirect management, which lets site administrators handle URL changes easily without negatively impacting SEO or the user experience.

Let's now look at how these redirects work and how to set them up in Ghost CMS.

Understanding HTTP redirects

Types of HTTP redirects

There are several types of HTTP redirect, the main ones being 301 and 302 redirects. But others exist too, even if they're used less often:

1. HTTP 301 (Permanent redirect)

A 301 redirect is used to move content permanently from one URL to another.

It tells search engines that the old URL is no longer valid and that the content has been moved for good.

This helps preserve the SEO value built up by the old URL and transfer it to the new one.

For example, if you rename a blog post, a 301 redirect ensures that search engines and visitors will still find the content at its new address.

2. HTTP 302 (Temporary redirect)

A 302 redirect is used to temporarily send users to another URL.

Unlike the 301 redirect, it doesn't tell search engines that the old URL is obsolete, only that the content has been temporarily moved.

This can be handy for seasonal promotions or temporary content updates.

3. Other HTTP redirects

Other types of redirect exist, such as HTTP 303, 307 and 308, but Ghost CMS mainly uses 301 and 302 for the majority of redirect needs.

These other redirects have specific uses, often tied to HTTP request methods (GET, POST), and are less common for standard content management.

Why redirects matter in Ghost CMS

1. Preserving SEO value

How a 301 redirect transfers the SEO value of a URL

Redirects are crucial for preserving link equity and your SEO ranking.

When you change a piece of content's URL, a proper redirect transfers the SEO value from the old URL to the new one, so you don't lose the traffic and ranking you've built up.

2. User experience

A well-configured redirect improves the user experience by avoiding 404 errors.

Visitors are automatically sent to the new URL, which makes browsing feel smoother and more professional.

3. Updating content

Sometimes you need to update URLs to reflect changes to blog post titles or dates. However, it's best to avoid this practice for SEO reasons.

Ideally, URLs shouldn't contain dates or numbers. For instance, instead of a URL like "seo-trends-2023", simply use "seo-trends".

This avoids the need for frequent redirects and keeps your links stable over the long term.

If you absolutely must update a URL, make sure you set up a 301 redirect so that existing links still point to the updated content.

Setting up redirects in Ghost CMS

1. Open the admin panel

To get started, open your Ghost CMS admin panel. Navigate to Settings → Labs.

2. Download the redirects file

Download the redirects.yaml file, which contains your site's current redirects.

3. Edit the redirects file

Open the redirects.yaml file in a text editor. This file uses the YAML format to define redirects.

Here's an example YAML snippet for a simple redirect:

301:
  /tag/*: /*/
  /tag/web-design/page/2/: /web-design/
  /tag/advertising/: /advertising/
  /tag/mathilde-konczynski/: /mathilde-konczynski/
  /tag/web-design/: /web-design/
  /content/images/: /
  /ne-postez-pas-vos-evenements-sur-eventbrite/: /eventbrite-vs-tickettailor/
  /tag/articles/: /articles/
  /liste-doutil-utile-pour-travailler-sur-le-web/canva.com/: /liste-doutil-utile-pour-travailler-sur-le-web/
  /monthly-web-hosting/ : /hebergement-ghost-cms/
  /configuration-et-installation-ghost-cms-200/ : /hebergement-ghost-cms/
  /hebergement-ghost-cms/ : /creer-un-site-internet-ou-blog-avec-ghost-cms/
  /creez-votre-site-internet-ou-blog-avec-ghost-cms/ : /creer-un-site-internet-ou-blog-avec-ghost-cms/
  /contact-us/ : /ecrivez-nous/
  /tag/hosting/ : /hebergement-web/
  /hosting/ : /hebergement-web/
  /service-exclusif-pour-associations-creation-et-hebergement-web-a-25-par-mois/ : /creation-de-site-internet-et-hebergement-web-pour-les-associations/

In this example, the redirect is permanent, indicated by 301:

4. Upload the updated file

Once you've made your changes, upload the updated redirects.yaml file to Ghost CMS via the same path under Settings → Labs.

Advanced redirect techniques

1. Redirects for CMS migration

When migrating from another CMS to Ghost, it's crucial to set up redirects to make sure all your old links point to the new URLs in Ghost. This preserves traffic and avoids 404 errors.

Practical migration examples in Ghost CMS

1. Changing a blog post's title and URL

When a blog post's title changes, it's often a good idea to update the URL so it reflects the new title.

This can improve your search ranking by including relevant keywords and making the URL more descriptive and appealing to users.

Steps to follow:

2. Updating URLs for outdated content

Outdated content can hurt your site's user experience and SEO. By redirecting old URLs to updated versions, you keep your content relevant and improve the user experience.

Steps to follow:
  1. Identify outdated content: Review your site and pinpoint the posts that are no longer relevant or up to date.
  2. Create new content: Write and publish refreshed posts to replace the old ones.
  3. Set up a 301 redirect: Redirect the old URLs to the new, updated versions:
    • Go to Settings → Labs and download the redirects.yaml file.
    • Add entries for each outdated URL:
301:
  /old-outdated-url: /new-updated-url

More information is available in English on Ghost's official documentation:

[Implementing redirects in Ghost

Avoid broken links by redirecting old URLs to new ones. In this tutorial, learn everything you need to know about Ghost’s redirect process.

TutorialsTeam Ghost

](https://ghost.org/tutorials/implementing-redirects/)

Best practices for redirects

1. SEO considerations

  • Avoid redirect chains and loops Redirect chains can slow down page load times. Try to keep them to a minimum.
  • Monitor your redirects regularly Use tools like Google Search Console to check that your redirects are working correctly and that you don't have any 404 links.

2. User experience

Make sure your redirects lead to relevant content. Keep a consistent site structure to make navigation easier.

Troubleshooting common issues

1. Debugging redirect errors

If a redirect isn't working, check the redirects.json file for syntax errors or conflicts.

Use tools like HTTP Status to test your redirects.

2. Monitoring redirects

Tools like https://bernard.app/ or https://www.drlinkcheck.com/ can help you track how well your redirects are performing and spot any potential issues.

Conclusion

Setting up redirects in Ghost CMS is essential for maintaining your SEO and delivering a great user experience. Redirects ensure your content stays accessible and relevant, even after URL changes.

Monitor your redirects regularly and make sure they lead to relevant content. Use redirects to improve navigation and the user experience.

Set up redirects on your Ghost CMS today to boost your SEO and give your visitors a better experience.

Related articles


14-day free trial · No credit card