I'm trying to rewrite the URL of a node. I have the following test code:
function mymodule_url_outbound_alter(&$path, &$options, $original_path) {
if ($path == 'testpage') {
$path = 'test-alias';
$options['alias'] = $path;
}
}
Which doesn't seem to do anything when I visit /testpage or /test-alias. It's definitely executing the code inside the if statement. Am I doing something wrong here?
I have previously implemented hook_url_inbound_alter(), which works perfectly and doesn't do anything on this particular page. I also use the Path module.