• 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.

    https://www.nativenoise.co.za/820/the-winter-olympics-bebop-rocksteady/
    would intelligently redirect to
    https://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');
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Links to old permalink structure don’t redirect with wp-404-handler’ is closed to new replies.