Skip to main content

Redirects

Redirects send visitors (and search engines) from an old address on your directory’s domain to a new one. They are the same rules you manage under Settings → Redirects in the panel, useful when you migrate a site to Directify, rename pages, or retire listings. A redirect has three fields:
  • from - the old path on your own domain, starting with / and without the domain, e.g. /old-page. A path matches with or without a trailing slash, so /old-page and /old-page/ are the same rule and only one of them can exist.
  • to - where to send the visitor: a path on your directory such as /new-page, or a full URL such as https://example.com/landing. Not needed for a 410.
  • status - 301 permanent redirect, 302 temporary redirect, or 410 gone (the page was removed on purpose; search engines drop it).

List Redirects

Returns 100 redirects per page, newest first. Parameters:
  • directory_id (integer, required): The ID of the directory
  • page (integer, optional): Page number
  • search (string, optional): Only redirects whose from or to contains this text
  • status (integer, optional): Only redirects with this status (301, 302 or 410)
Response:

Get Single Redirect

Response:

Create Redirect

Request Body:
Request Body Fields:
  • from (string, required): The old path, starting with /, no domain, no spaces (max 255 characters). A missing leading slash is added for you. One rule per path.
  • to (string, required for 301 and 302): A path starting with / or a full http(s):// URL (max 255 characters). Ignored for 410.
  • status (integer, required): 301, 302 or 410
A 410 needs no destination:
Response: the created redirect under data, status 201.

Update Redirect

Send only the fields you want to change. Setting status to 410 clears to.

Delete Redirect

Response:

Notes

  • Redirects are resolved before routing, so a from path can point at an address that has never existed on Directify, which is what you need when moving from another platform.
  • A from path cannot be the web address prefix of one of your directory’s extra languages (for example /es).
  • Redirects take effect at once; cached pages for the directory are refreshed when a rule changes.