Canonical redirect to correct location if rss2 is not default feed. wp-feed.php redirection to default feed type instad of rss2. Props solarissmoke. Fixes #13047

git-svn-id: https://develop.svn.wordpress.org/trunk@14162 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2010-04-19 12:03:01 +00:00
parent 8fc4c41c77
commit d10ff2dfc5
2 changed files with 3 additions and 3 deletions

View File

@ -1,12 +1,12 @@
<?php <?php
/** /**
* Redirects to the RSS2 feed * Redirects to the default feed
* This file is deprecated and only exists for backwards compatibility * This file is deprecated and only exists for backwards compatibility
* *
* @package WordPress * @package WordPress
*/ */
require( './wp-load.php' ); require( './wp-load.php' );
wp_redirect( get_bloginfo( 'rss2_url' ), 301 ); wp_redirect( get_bloginfo( get_default_feed() . '_url' ), 301 );
?> ?>

View File

@ -190,7 +190,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
$addl_path = !empty( $addl_path ) ? trailingslashit($addl_path) : ''; $addl_path = !empty( $addl_path ) ? trailingslashit($addl_path) : '';
if ( get_query_var( 'withcomments' ) ) if ( get_query_var( 'withcomments' ) )
$addl_path .= 'comments/'; $addl_path .= 'comments/';
$addl_path .= user_trailingslashit( 'feed/' . ( ( 'rss2' == get_query_var('feed') || 'feed' == get_query_var('feed') ) ? '' : get_query_var('feed') ), 'feed' ); $addl_path .= user_trailingslashit( 'feed/' . ( ( get_default_feed() == get_query_var('feed') || 'feed' == get_query_var('feed') ) ? '' : get_query_var('feed') ), 'feed' );
$redirect['query'] = remove_query_arg( 'feed', $redirect['query'] ); $redirect['query'] = remove_query_arg( 'feed', $redirect['query'] );
} }