A project I'm working on required automatically creating redirects based on certain user actions. Path Redirect + Rules seemed like a nice fit, so I dropped some rules hooks into Path Redirect to do what I needed. The attached patch seems to work (though my testing has been minimal so far). The patch is against 6.x-1.0-beta4, but it also applies to 6.x-1.0-dev as of Oct. 30, 2009.

The patch adds the following:

  • A "Path is being redirected" event, triggered just before the redirect happens,
  • an "URL redirect exists for path" condition, and
  • a "Create or delete an URL redirect" action.

A small start, but hopefully it helps.

CommentFileSizeAuthor
path_redirect.rules_.patch4.68 KBjcarnett

Comments

dave reid’s picture

Can this code be stuffed into a path_redirect.rules.inc file and not in the main file at all? Will adding proper hooks to the redirection help with this somehow?

dave reid’s picture

Status: Needs review » Closed (won't fix)

No response in almost a year, so marking as won't fix.