I am trying to rewrite www.site.com/profile to www.site.com/activity but in the meantime www.site.com/profile/username/edit and other url segments stay as the default. Some of my code:
// start.php
function profile_route_rewrite_handler($hook, $type, $value, $params)
{
$value['identifier'] = 'activity';
return $value;
}
elgg_register_plugin_hook_handler('route:rewrite', 'profile', 'profile_route_rewrite_handler');
but this will rewrite all of the segments for profile page. Any idea? Thanks
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- iionly@iionly

iionly - 0 likes
- damieneskimo@damieneskimo

damieneskimo - 0 likes
You must log in to post replies.You need to check $value['segments'] (the url segments after /profile/) as you don't want to re-route if the url points to a profile page. I think $value['segments'] is an array if the url has segments and an empty string if not. Just try
It works perfect. Thanks, iionly ;)