WordPress.org

Make WordPress Core

Ticket #19607: 19607.2.diff

File 19607.2.diff, 638 bytes (added by nacin, 6 years ago)
  • wp-includes/canonical.php

     
    9292                        }
    9393                }
    9494
     95                if ( ! $redirect_url && get_option( 'home' ) != get_option( 'url' ) ) {
     96                        if ( $original['path'] == home_url( 'wp-admin/', 'relative' ) )
     97                                $redirect_url = admin_url();
     98                        elseif ( $original['path'] == home_url( 'wp-login.php', 'relative' ) )
     99                                $redirect_url = site_url( 'wp-login.php', 'login' );
     100                }
     101
    95102                if ( ! $redirect_url )
    96103                        $redirect_url = redirect_guess_404_permalink( $requested_url );
    97104