【发布时间】:2013-03-26 13:55:14
【问题描述】:
我目前正在做一个项目,我需要它来操纵参数以达到美学目的。
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 级层次结构,但我想做的是根据当前“用户列表”的多少级别使其具有一定的动态性"有。
任何帮助将不胜感激。
【问题讨论】: