Jump to main content Jump to doc navigation

A Symlink forwards a request to another Resource. It keeps the URL the visitor used and returns the target’s content in the same response. It is not an HTTP redirect: the status is 200, and search engines see the content at both URLs. Unlike a 301, it does not pass ranking signals to the target.

For a 301, use a Weblink with a 301 Response Code, or a server-level redirect.

Use Cases

  • Keep an old URL working after a Resource moves. Add a canonical tag if duplicate content matters for search.
  • Show the same content at more than one place in the tree without duplicating it.
  • Provide a short URL for a Resource deep in the tree.
  • Cover spelling variants of a URL, each as a separate Symlink.

Target

The content field holds the target Resource ID. A tag is accepted if it renders a numeric ID. A URL or alias is not supported: sendForward() converts the value to an integer, so a non-numeric target ends on the error page. Use a Weblink for external URLs.

The target must exist. MODX rejects a non-numeric value and a missing Resource when you save a Symlink. A value that contains tags skips that check and is resolved at request time.

The update processor also rejects a Symlink that points to itself. The create processor does not, so avoid entering the new Resource’s own ID.

Target visibility and permissions

An unpublished target is not returned to anonymous visitors: MODX treats it as missing and sends the 404 error page. A signed-in manager user with view_unpublished can open it.

The target’s view permission is checked during the forward. A Symlink in another Resource Group does not grant access to the target; it adds another check. A Symlink can narrow access, not widen it.

Fields and caching

The Symlink’s non-empty fields can override the target’s fields, depending on symlink_merge_fields. The content field always stays the target ID. See Using Resource Symlinks for the exclusions.

If the target does not appear after you save, clear the site cache and the document cache.

See Also

  1. Content Types
  2. Named Anchor
  3. Static Resource
  4. Symlink
  5. Using Resource Symlinks
  6. Weblink

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.

Backers

  • modmore
  • STERC
  • Digital Penguin
  • Jens Wittmann – Gestaltung & Entwicklung
  • CrewMark
  • Fabian Christen
  • Sepia River Studios
  • Dannevang Digital
  • A. Moreno
  • Alex
  • Chris Fickling
  • Stéphane Jäggi
  • Murray Wood
  • Anton Tarasov
  • JT Skaggs
  • deJaya
  • Lefthandmedia
  • eydolan
  • Following Sea
  • Guido Gallenkamp
  • YJ
  • Raffy
  • Snow Creative
  • Nick Clark
  • Guest
  • Helen
  • krisznet
  • Yanni
  • Richard

Budget

$194 per month—let's make that $500!

Learn more