这是我网站的个人资料页面的 htaccess 规则:
RewriteRule ^users/([0-9]+)/?(.+)?/?(.+)? profile.php?id=$1&slug=$2&tab=$3&%{QUERY_STRING}
当您单击用户个人资料上的选项卡时,例如收藏夹:
/users/83028/nathan-johnson/favorites
根据a $_GET
,名称为slug的变量正在接收nathan-johnson/favorites
而不是 justnathan-johnson
并且tab
变量为空白var_dump
:
array(3) {
["id"]=> string(5) "83028"
["slug"]=> string(24) "nathan-johnson/favorites"
["tab"]=> string(0) "" }
看起来问题出在我的 htaccess 正则表达式(上),但我没有看到它的问题。
提前致谢。