Rebuilding site URLs

Needs / Issues

  • Drupal site URLs lost, need to recreate them;
  • "Page not found" error persistent, can't browse to any page.

Audience

  • Drupal Developer;
  • Drupal Administrator.

Initial Setting

  • Drupal 6.x & 7.x site;
  • Bad, corrupt or missing menu_router table (site URLs).

Steps

  • In website's root:
    1. Add the following line to your index.php:
      menu_rebuild();
      Can add it to the end of index.php or just after the Drupal bootstrap.
       
  • In your web browser:
    1. Browse to your website;
    2. The menu router table should be rebuilt.
  • In website's root (again):
    1. Remove the line added inside index.php.

If your issue is still not solved, you can check this Drupal post, the Drupal Documentation, or send me a message.