Skip to content

Instantly share code, notes, and snippets.

@megclaypool
Last active March 12, 2025 06:34
Show Gist options
  • Save megclaypool/cb69db4d007168fe5099bcecd51380fa to your computer and use it in GitHub Desktop.
Save megclaypool/cb69db4d007168fe5099bcecd51380fa to your computer and use it in GitHub Desktop.

Redirecting visitors from an auto-generated taxonomy term page to a node (like a landing page) is totally doable, but there's a trick to it!

You can't just type the auto-generated url for the taxonomy term into the redirect; for whatever reason it just doesn't work. (For example, "resource-types/law-overviews" wouldn't work.) Instead, you need to use the taxonomy term number.

Go to the term listing page for the taxonomy. Click or hover over the edit button to get the edit url, which incldes the term number.

Then in the redirect, you put /taxonomy/term/THE-TERM-NUMBER-YOU-JUST-FOUND into the "From" field, and use autocomplete to select the desired node "To" field.

ex: From: /taxonomy/term/118 To: Law Overviews (416757)

This is a little complicated, so let me know if I didn't explain it clearly enough 😛

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment