• hi guys,

    i noticed that my blog does 302 redirection after i changed permalinks names, and i thought to share this finding, is very handy, actually i would like to know the reason for the devs didnt implement it in the first place.

    in wp-trackback.php around line 80 the code looks like that:

    if (empty($title) && empty($tb_url) && empty($blog_name)) {
    // If it doesn’t look like a trackback at all…
    wp_redirect(get_permalink($tb_id));
    exit;
    }

    CHANGE IT TO

    if (empty($title) && empty($tb_url) && empty($blog_name)) {
    // If it doesn’t look like a trackback at all…
    wp_redirect(get_permalink($tb_id),301);
    exit;
    }

    job done, redirects are now 301!

    Gabrio

Viewing 3 replies - 1 through 3 (of 3 total)
  • No! Never, ever, edit WordPress core scripts. And do not encourage others to do so. Editing core scripts can bring down your entire site and/or open security holes for hackers to use.

    Thread Starter gab81

    (@gab81)

    for a 301? i disagree, is an important change for an SEO perspective.

    but like i said, i would like to hear a dev because perhaps there’s some other reason why it does 302 by default, which is “temporary redirect”. perhaps they assume that the changes would be temporary but in my case they are not.

    gabrio

    Then I suggest you raise this on the wp-hackers mailing list but editing core is not the way to go here.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing 302 redirects for permalinks to 301’ is closed to new replies.