Forums

Links to old permalink structure don't redirect with wp-404-handler (1 post)

  1. NativePaul
    Member
    Posted 2 weeks ago #

    I'm using the wp-404-handler.php method to get pretty permalinks for my site.

    I recently changed the permalink structure from /%post_id%/%postname%/ to /%year%/%monthnum%/%postname%/

    The problem is that a lot of links on external sites use the old structure which returns a 404 page. Changing the permalink structure on a local testing server using WAMP didn't do any damage at all.

    http://www.nativenoise.co.za/820/the-winter-olympics-bebop-rocksteady/
    would intelligently redirect to
    http://www.nativenoise.co.za/2009/08/the-winter-olympics-bebop-rocksteady/

    Is there any way to do that using the wp-404-handler.php method on a windows server?

    This is the code in my wp-404-handler.php file:

    <?php
    $_SERVER['REQUEST_URI'] = substr($_SERVER['QUERY_STRING'], strpos($_SERVER['QUERY_STRING'], ':80')+3);
    $_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
    include('index.php');
    ?>

Reply

You must log in to post.

About this Topic