Search code examples
drupalhttp-redirectdrupal-6drupal-taxonomy

Looking for a Drupal Module that will Redirect Pathauto urls when a node is deleted


Looking for a Drupal 'Redirect When Deleted" module.

We have a classifed listing site built on drupal , so we have large numbers of listings that are published and then removed from the site on an ongoing basis. Currently when a listing is removed from the site we leave it unpublished (no content is ever deleted) and redirect the user to a search for simular listings. Giving them a nice "The listing you are looking for is no longer listed, here are more like it."

We are looking to start archiving listings and removing the old unpublished listings from the site. We need a module that will keep the PathAuto generated path from the deleted node and 301 redirect the user to a search result for that listing. This should happen automatically once the listing is deleted, based on the taxonomy of the node.

I'm aware of the path_redirect module. It does not provide the automatic functionality we are looking for. I've searched around and before building my own I figured I'd post a question here, see if there is something that I'm missing.


Solution

  • Kind of shooting from the hip here, but it sounds as though you need custom functionality. On hook_nodeapi() $op == 'delete' you want to use path_redirect_save() to save the node's current alias as a redirect pointing to the search page.

    This functionality might be something the maintainer of path_redirect would accept as a configurable option.