In brief, this project could help you rewrite the URLs.
1. sub urls of node and user will be rewritten when the parent url has an alias.
2. you can use regex to rewrite any url if you want
NOTICE: no need to enable this module, just include the core in your settings.php
In Drupal, we have node and user. In many cases, node|user has many sub-tab menu, such as node/%/info node/%/devel and any other MENU_LOCAL_TASK.
If you use url_alias, you need to add alias for each of them. This module, Rewrite Sub Link, will help you rewrite them automatically, and which doesn't user url_alias, so when you have millions of node, it won't case a performance issue.
Additionally, this module support regular express, so you can write your regular express to change your URL.
Light-weight Usage
add this line in the settings.php file,
include_once "sites/all/modules/contrib/rewrite_sub_link/rewrite_sub_link.core.inc";
add your custom settings in your settings.php
include_once "path_to_your_custom_rewrite_settings.php"
or change the code in rewrite_sub_link/rewrite_settings.php directly.
then all the sub links of user and node will be rewritten automatically.
Please check rewrite_settings.php file and change for your custom settings.
NOTICE