OGraphr for WordPress
WP in own directory causing "circular redirect" due to trailing slash difference (5 posts)

  1. pleasureinstitute
    Posted 3 years ago #

    Using Facebook's Object Debugger, I've found that Ographr outputs og:url as it is according to WP (without a trailing slash to prevent double-slash in permalinks). This causes a "Circular redirect path" and a discrepancy between og:url and rel='canonical', at least if WP is in its own directory.

    WP/Site Address is "http://www.example.com/wp" (in settings)
    rel="canonical" is "http://www.example.com/wp/"
    og:url is "http://www.example.com/wp"

    The fix is to just append the trailing slash when outputting og:url if is_front_page() || is_home() || is_404() and trailing slash isn't present.


  2. idleberg
    Plugin Author

    Posted 3 years ago #

    i've added a quick fix to the upcoming version, but i have also noticed that i don't run into the problem on any of my sites. could this be a question of apache redirect rules?

  3. pleasureinstitute
    Posted 3 years ago #

    Apache redirecting a non-trailed dir to trailed? I always thought that was standard?

  4. pleasureinstitute
    Posted 3 years ago #

    I may have not been clear enough. It's not an apache redirect. It's Facebook considering the og:url info to be the "real" site that it should scrape data from.

    It goes as follows:

    1. I submit "http://www.example.com/wp/" to Facebook Debugger.
    2. Facebook Debugger reads og:url which is "http://www.example.com/wp"
    3. Facebook Debugger GETs "http://www.example.com/wp"
    4. Apache redirects untrailed to trailed -> "http://www.example.com/wp/"
    5. goto 2, causing "circular redirect"
  5. idleberg
    Plugin Author

    Posted 3 years ago #

    i tried to reproduce this, but i don't get any warnings in the fb debugger. let me know what happens when you overwrite meta-ographr_index.php with this:


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • OGraphr for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic