Forums

Fixing Trackback URL if your WP is hosted on Windows. (2 posts)

  1. phpkid
    Member
    Posted 8 years ago #

    Hi,

    By default, Trackback URL for your posts takes the form of

    http://your/blog/url/wp-trackback.php/<<post_id>&gt;

    Though this will work on *nix /Apache, it breaks on IIS/Windows. To fix the problem, open function trackback_url in wp-includes/template-functions-comment.php.

    Replace line

    '$tb_url = get_settings('siteurl') . '/wp-trackback.php/' . $id;'

    with


    //Determine if WP is hosted on Windows/IIS.
    $is_IIS = strstr($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') ? 1 : 0;
    if($is_IIS)
    {
    $tb_url = get_settings('siteurl') . '/index.php?p=' . $id;
    }
    else
    {
    $tb_url = get_settings('siteurl') . '/wp-trackback.php/' . $id;
    }

    Hope this helps someone,
    JD

  2. phpkid
    Member
    Posted 8 years ago #

    In case you wanted to download modified file directly (for version 1.2.2)

    Check this post on my weblog:

    http://jdk.phpkid.org/index.php?p=1146

    JD

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.