WordPress.org

Forums

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

  1. pleasureinstitute
    Member
    Posted 1 year 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.

    Example:
    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.

    Thanks.

  2. idleberg
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Posted 1 year ago #

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

  4. pleasureinstitute
    Member
    Posted 1 year 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
    Member
    Plugin Author

    Posted 1 year 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:

    https://dl.dropboxusercontent.com/u/353649/meta-ographr_index.php.zip

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