私は現在、審美的な目的でパラメータを操作するためにこれが必要なプロジェクトに取り組んでいます。
add_rewrite_rule( '([^/]*)/user/([^/]+)','index.php?pagename=$matches[1]&username=$matches[2]', 'top' );
-> would correctly retrieve the userID (in this case 232) from the following URL: http://mysite.com/userlisting/user/232
add_rewrite_rule( '([^/]*)/([^/]*)/user/([^/]+)','index.php?pagename=$matches[1]&username=$matches[2]', 'top' );
-> would correctly retrieve the userID (in this case 232) from the following URL: http://mysite.com/parent_directory/userlisting/user/232
これで、たとえばこれらのルールを10個追加して、少なくとも10レベルの階層を確実に実行できますが、現在の「ユーザーリスト」のレベル数に基づいて、ある程度動的にすることができます。
どんな助けでも大歓迎です。