Making WordPress.org


Ignore:
Timestamp:
10/16/2019 07:40:19 AM (5 years ago)
Author:
dd32
Message:

WordPress.org: /feed/ should redirect to the News feed.

See #4282.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-canonical-tweaks.php

    r8399 r9191  
    2424
    2525}, 9 ); // Before redirect_canonical();
     26
     27/*
     28 * WordPress.org/feed/* should redirect to WordPress.org/news/feed/*
     29 */
     30if ( 'wordpress.org' === $_SERVER['HTTP_HOST'] && '/feed' === substr( $_SERVER['REQUEST_URI'], 0, 5 ) ) {
     31    add_action( 'template_redirect', function() {
     32        if ( is_feed() ) {
     33            wp_safe_redirect( '/news' . $_SERVER['REQUEST_URI'], 301 );
     34            exit;
     35        }
     36    }, 9 ); // Before redirect_canonical();
     37}
Note: See TracChangeset for help on using the changeset viewer.