WordPress.org

Forums

[Plugin: Smart 404] Hack to make short links (1 post)

  1. mango45
    Member
    Posted 5 years ago #

    Marvelous! An excellent plugin that works just as it should.

    I modified it slightly to allow dynamic shortlinking:

    $possible_post_id = trim($_SERVER['REQUEST_URI'], '/');
    if (is_numeric($possible_post_id) and $permalink = get_permalink($possible_post_id)) {
     // 301 to the proper link if just the post ID is used.  Good for dynamic short links.
     wp_redirect($permalink, 301);
     exit;
     }

    http://wordpress.org/extend/plugins/smart-404/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags