Where conditional rewrite is desired, not supported by existing path modules, and where we'd prefer to stay out of .htaccess, where might we hook in Drupal 6?

Along the lines of Drupal 7 hook_URL_inbound_alter, I think.

2 Answers 2


hook_URL_inbound_alter was introduced as part of a contributed module in Drupal 6 (URL alter), and was moved to core with Drupal 7.


In Drupal 6, the equivalent of hook_url_inbound_alter() is custom_url_rewrite_inbound() which is not a hook, but a function to put in the settings.php file used by Drupal.

The URL alter module defines that function, and call any implementation of hook_url_inbound_alter() defined from other modules, allowing modules to use the same code for Drupal 6, and Drupal 7.

The same is true for custom_url_rewrite_outbound(), and hook_url_outbound_alter().

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.