0

I'm on a old site on drupal 7. I have a node with alias /url. Now I need to manage that page url programmatically, so I create an item in a custom module using hook_menu() in this way:

/**
 * Implements hook_menu().
 */
function MYMODULE_menu() {
  $items = [];

  $items['url'] = [
    'title' => 'New Title',
    'page callback' => 'MYMODULE_url_callback',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  ];

  return $items;
}

In the previous node I've changed the alias to /url-old but when I go to the page /url I've been redirected to /url-old and can't reach the new page.

Where is still referenced the relation between node/<nid> and his old alias /url?

I've the module Pathauto installed. In the aliases list the /url link is no more present.

Thanks in advance.

2
  • Look for a redirect on the Redirect config screen, /admin/config/search/redirect. Or Via admin toolbar: Manage > Configuration > Search and metadata > URL redirects. Edit: Woops, these paths are for D8/D9, but the idea is the same.
    – sonfd
    Commented Jan 18, 2022 at 14:20
  • Thanks @sonfd! It was not Pathauto but redirects configuration. It resolves :)
    – robdex
    Commented Jan 18, 2022 at 15:41

1 Answer 1

0

I've found where are defined all node's redirects:

Configuration > Search and metadata > URL aliases.

Needs to remove all occurrence for the new url before to reach the page programmatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.