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:
parent
8fc4c41c77
commit
d10ff2dfc5
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Redirects to the RSS2 feed
|
||||
* Redirects to the default feed
|
||||
* This file is deprecated and only exists for backwards compatibility
|
||||
*
|
||||
* @package WordPress
|
||||
*/
|
||||
|
||||
require( './wp-load.php' );
|
||||
wp_redirect( get_bloginfo( 'rss2_url' ), 301 );
|
||||
wp_redirect( get_bloginfo( get_default_feed() . '_url' ), 301 );
|
||||
|
||||
?>
|
@ -190,7 +190,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
|
||||
$addl_path = !empty( $addl_path ) ? trailingslashit($addl_path) : '';
|
||||
if ( get_query_var( 'withcomments' ) )
|
||||
$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'] );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user