When WordPress is in a subdirectory (home URL != site URL), let home/wp-admin and home/wp-login.php redirect to their proper locations. props greuben for initial patch, fixes #19607.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6ef54c2016
commit
ef1e76a833
|
@ -92,6 +92,13 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
|
|||
}
|
||||
}
|
||||
|
||||
if ( ! $redirect_url && get_option( 'home' ) != get_option( 'url' ) ) {
|
||||
if ( $original['path'] == home_url( 'wp-admin/', 'relative' ) )
|
||||
$redirect_url = admin_url();
|
||||
elseif ( $original['path'] == home_url( 'wp-login.php', 'relative' ) )
|
||||
$redirect_url = site_url( 'wp-login.php', 'login' );
|
||||
}
|
||||
|
||||
if ( ! $redirect_url )
|
||||
$redirect_url = redirect_guess_404_permalink( $requested_url );
|
||||
|
||||
|
|
Loading…
Reference in New Issue