By runeveryday on
i want to use custom_url_rewrite_outbound alter the "admin" to "config" for safety.this is my code.
function custom_url_rewrite_outbound(&$path, &$options, $original_path) {
global $user;
if (preg_match('|^node(/.*)|', $path, $matches)) {
$path = 'config'. $matches[1];
}
if ($path == 'user/'. $user->uid .'/edit') {
$path = 'e';
}
}
when i put this into the setting.php file, it can't work. who can tell me where is the error.or give me a right one.any tips would be appreciated!
Comments
Doing the same...
I'm having no luck. Only thing I can offer is that there is a module for this : http://drupal.org/project/url_alter which saves editing settings.php
I have used rewrite_inbound to replace spaces with hypens, and remove $ignore_words, in taxonomy terms present in links, which works great, but I get 404 when trying to use the links. I've given up with trying outbound and for now I've added to hyphens into the Taxonomy terms and used theme_menu_item_link in my template.php file to remove the hyphens from the menu titles.
Might be a workable solution in some cases. If I get this working with url_alter, I'll post.