Within the Ultimatum's theme childtheme.php I've added rewrite rules to the rewrite rules and it works perfectly fine. However, it does not work if the URL is shared in Facebook or Twitter.

The Facebook debugger returns "Could Not Follow Redirect Path" for any of the pages using the rewrite rule.

URL to try: http://www.teamrealty.ca/listing-details/839215/res/5801-Longhearth-Wa/ debugger: https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fwww.teamrealty.ca%2Flisting-details%2F839215%2Fres%2F5801-Longhearth-Wa%2F

rewrite rules function

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');
  • This rewrite rule doesn't redirect (only, well, rewrites), I see no redirect on the link at all in REDbot. Not sure what's Facebook problem, since it requires login. Can you reproduce in some public tool?
    – Rarst
    Jun 19, 2014 at 19:55

1 Answer 1


The rel canonical link points to http://www.teamrealty.ca/listing-details/, which returns a 500 internal server error response code. You can try to remove the canonical action before wp_head() is called on those pages:

remove_action( 'wp_head', 'rel_canonical' );
  • Thanks @Milo. That lead me in the right direction and I found stackoverflow.com/questions/2430623/… and I'm using something similar. The remove_action is not working though. I now get two canonical link tags.
    – spiderling
    Jun 20, 2014 at 0:17
  • probably an SEO plugin adding it.
    – Milo
    Jun 20, 2014 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.