### YAML Redirect Rules Example Source: https://ghost.org/help/redirects This example demonstrates the correct YAML format for defining both permanent (301) and temporary (302) redirects in Ghost. Ensure you use spaces for indentation, not tabs. The format maps old URLs to new URLs. ```yaml 301: /permanent-redirect-from: /permanent-redirect-to /permanent-redirect-from-2: /permanent-redirect-to-2 302: /temporary-redirect-from: /temporary-redirect-to ``` -------------------------------- ### Configure Subdomain DNS Records with GoDaddy for Ghost(Pro) Source: https://ghost.org/help/godaddy-domain-setup-guide These DNS records are required to map a subdomain (e.g., www.yourdomain.com) to your Ghost(Pro) publication. A CNAME record points the subdomain to your Ghost publication's address, and an A record handles redirection for the root domain. ```dns Record Type | Host | Value CNAME | www | .ghost.io A | @ | 178.128.137.126 ``` -------------------------------- ### Netlify TOML Redirects for Ghost Subdirectory Source: https://ghost.org/help/run-ghost-from-a-subdirectory This configuration for Netlify's `netlify.toml` file sets up redirects to proxy requests for the '/blog' subdirectory to your Ghost(Pro) instance. It includes rules for both the root '/blog' path and paths containing '/blog/*'. Ensure that `.ghost.io` and `` are replaced with your actual Ghost subdomain and custom domain, respectively. ```toml [[redirects]] from = "/blog/*" to = "https://.ghost.io/blog/:splat" status = 200 force = true headers = {X-Forwarded-Host = ""} [[redirects]] from = "/blog" to = "https://.ghost.io/blog/" status = 200 force = true headers = {X-Forwarded-Host = ""} ``` -------------------------------- ### NextJS Reverse Proxy Configuration for Ghost(Pro) Subdirectory Source: https://ghost.org/help/run-ghost-from-a-subdirectory This NextJS configuration file (`next.config.js`) sets up a reverse proxy to establish a subdirectory on Ghost(Pro). It includes `trailingSlash: true` and defines rewrites to direct traffic to the correct Ghost(Pro) subdomain. ```javascript /** @type {import('next').NextConfig} */ const nextConfig = { trailingSlash: true, async rewrites() { return [ { source: "/blog/:path*/", destination: "https://.ghost.io/blog/:path*/", }, { source: "/blog/:path*", destination: "https://.ghost.io/blog/:path*" } ]; } } module.exports = nextConfig ``` -------------------------------- ### Vercel Reverse Proxy Configuration for Ghost(Pro) Subdirectory Source: https://ghost.org/help/run-ghost-from-a-subdirectory This Vercel configuration uses `vercel.json` to set up a reverse proxy for a Ghost(Pro) subdirectory. It requires updating the `.ghost.io` and the subdirectory path (e.g., `/blog/`). ```json { "rewrites": [ { "source": "/blog/:match*", "destination": "https://.ghost.io/blog/:match*" }, { "source": "/blog/:match*/", "destination": "https://.ghost.io/blog/:match*/" } ] } ```