Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter eric3d

    (@eric3d)

    Adding a slash to line 102 fixed the problem for me. But it may break for other installations. So I can’t mark it resolved.
    $metadata_arr[] = '<meta property="og:url" content="' . esc_url_raw( get_bloginfo('url') ) . '" />';
    became
    $metadata_arr[] = '<meta property="og:url" content="' . esc_url_raw( get_bloginfo('url') ) . '/" />';

    Plugin Author George Notaras

    (@gnotaras)

    Hello Eric,

    Thanks for your feedback. I’ll do some research about this issue and fix it, if necessary.

    In the meantime, it is possible to use a filtering function as a workaround in order to fix it as cleanly as possible without manually editing the plugin source code.

    For example:

    function fix_og_site_url( $metatags ) {
        // fix 'og:url' metatag here...
        return $metatags;
    }
    add_filter( 'amt_opengraph_metadata_head', 'fix_og_site_url', 10, 1 );

    This code can be added in the functions.php file of the theme or in another plugin. Read more about the available filters in the description page of the plugin.

    Hope you find this workaround useful.

    Plugin Author George Notaras

    (@gnotaras)

    Eric, I haven’t forgotten about this. I’ll try to do some thorough testing after installing WP in a directory.

    Plugin Author George Notaras

    (@gnotaras)

    Hi Eric,

    Can you confirm that this is still an issue? I’m releasing 2.5.1 really soon, so I’d like to know whether I should include a fix or not.

    Thanks in advance.
    George

    Thread Starter eric3d

    (@eric3d)

    Hi George,

    The bug was initially reported with version 2.4.3 and is still present in version 2.5.0. Reapplying the hack in my second post fixed it for me (but it would probably cause a double slash for root installations, so a condition should be added).

    Eric

    Plugin Author George Notaras

    (@gnotaras)

    Hi Eric,

    Thanks for the quick reply. Much appreciated.

    AFAIK, the output of get_bloginfo('url') does not return a URL with a trailing slash in both root or directory installations, so I guess your workaround should be OK. Nevertheless, I intend to use the trailingslashit() WP function, which would take care of a possible double trailing slash.

    Again, thanks for your feedback and sorry for taking me so long to resolve the issue.

    George

    Plugin Author George Notaras

    (@gnotaras)

    Fixed in 2.5.1. (changeset)

    Marking this topic as resolved. Thanks for your feedback.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Circular redirect due to trailing slash’ is closed to new replies.