WordPress.org

Support

Support » Plugins and Hacks » WP in own directory causing "circular redirect" due to trailing slash difference

WP in own directory causing "circular redirect" due to trailing slash difference

  • 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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author idleberg

    @yathosho

    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?

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

    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”
    Plugin Author idleberg

    @yathosho

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP in own directory causing "circular redirect" due to trailing slash difference’ is closed to new replies.