重写规则社交共享链接 时间:2014-06-19 作者:spiderling 在最后通牒的主题中,儿童主题。php我已经在重写规则中添加了重写规则,它工作得非常好。但是,如果URL在Facebook或Twitter上共享,则不起作用。Facebook调试器使用重写规则为任何页面返回“无法遵循重定向路径”。要尝试的URL:http://www.teamrealty.ca/listing-details/839215/res/5801-Longhearth-Wa/调试器:https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.teamrealty.ca%2Flisting-details%2F839215%2Fres%2F5801-Longhearth-Wa%2F重写规则功能function AddRewriteRules ($ar_rules) { $ar_new_rules = array(\'listing-details/([^/]+)/([^/]+)/([^/]+)/?$\' => \'index.php?pagename=listing-details&mls=$matches[1]&ret=$matches[2]\'); $ar_rules = $ar_new_rules + $ar_rules; return $ar_rules; } // hook add_rewrite_rules function into rewrite_rules_array add_filter(\'rewrite_rules_array\', \'AddRewriteRules\'); 1 个回复 最合适的回答,由SO网友:Milo 整理而成 rel规范链接指向http://www.teamrealty.ca/listing-details/, 返回500个内部服务器错误响应代码。您可以尝试在之前删除规范操作wp_head() 在这些页面上调用:remove_action( \'wp_head\', \'rel_canonical\' ); 结束 文章导航