Redirecting content to another Hugo site

On a production server (Apache, NGINX, etc.) you would create rewrite rules (pattern matching) then redirect to the new URL while issuing a meaningful HTTP status code (typically 301).

Though discouraged, you could also use the “meta refresh” approach:
https://en.wikipedia.org/wiki/Meta_refresh
https://www.w3.org/TR/WCAG10-HTML-TECHS/#meta-element

Here’s an example that redirects the browser to another domain for every “post” on the site.

In layouts/_default/baseof.html (or wherever you have defined the <head> element of your pages):

{{- if eq .Type "post" -}}
  <meta http-equiv="refresh" content="0; URL='https://www.example.com{{ .RelPermalink }}'" />
{{- end -}}
2 Likes