WordPress.org

Make WordPress Core

Changeset 19875


Ignore:
Timestamp:
02/08/12 17:08:13 (3 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/canonical.php

    r19778 r19875  
    9191                $redirect['query'] = remove_query_arg(array('p', 'page_id', 'attachment_id', 'post_type'), $redirect['query']); 
    9292            } 
     93        } 
     94 
     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' ); 
    93100        } 
    94101 
Note: See TracChangeset for help on using the changeset viewer.