WordPress.org

Make WordPress Core

Ticket #4604: 4604-redirect.diff

File 4604-redirect.diff, 2.7 KB (added by Otto42, 7 years ago)

Makes the root feed files do 301 redirects.

  • wp-atom.php

     
    11<?php 
     2define('WP_USE_THEMES', false); 
     3require('./wp-blog-header.php'); 
    24 
    3 if (empty($wp)) { 
    4         require_once('wp-config.php'); 
    5         wp('feed=atom'); 
    6 } 
    7  
    8 require (ABSPATH . WPINC . '/feed-atom.php'); 
    9  
     5wp_redirect(bloginfo('atom_url'),301); 
    106?> 
     7 No newline at end of file 
  • wp-commentsrss2.php

     
    11<?php 
     2define('WP_USE_THEMES', false); 
     3require('./wp-blog-header.php'); 
    24 
    3 if (empty($wp)) { 
    4         require_once('wp-config.php'); 
    5         wp('feed=rss2&withcomments=1'); 
    6 } 
    7  
    8 require (ABSPATH . WPINC . '/feed-rss2-comments.php'); 
    9  
     5wp_redirect(bloginfo('commentsrss2_url'),301); 
    106?> 
     7 No newline at end of file 
  • wp-feed.php

     
    11<?php 
     2define('WP_USE_THEMES', false); 
     3require('./wp-blog-header.php'); 
    24 
    3 if (empty($doing_rss)) { 
    4         $doing_rss = 1; 
    5         require(dirname(__FILE__) . '/wp-blog-header.php'); 
    6 } 
    7  
    8 do_feed(); 
    9  
    10 ?> 
     5wp_redirect(bloginfo('rss2_url'),301); 
     6?> 
     7 No newline at end of file 
  • wp-rdf.php

     
    1 <?php /* RDF 1.0 generator, original version by garym@teledyn.com */ 
     1<?php 
     2define('WP_USE_THEMES', false); 
     3require('./wp-blog-header.php'); 
    24 
    3 if (empty($wp)) { 
    4         require_once('wp-config.php'); 
    5         wp('feed=rdf'); 
    6 } 
    7  
    8 require (ABSPATH . WPINC . '/feed-rdf.php'); 
    9  
     5wp_redirect(bloginfo('rdf_url'),301); 
    106?> 
     7 No newline at end of file 
  • wp-rss.php

     
    11<?php 
     2define('WP_USE_THEMES', false); 
     3require('./wp-blog-header.php'); 
    24 
    3 if (empty($wp)) { 
    4         require_once('wp-config.php'); 
    5         wp('feed=rss'); 
    6 } 
    7  
    8 require (ABSPATH . WPINC . '/feed-rss.php'); 
    9  
     5wp_redirect(bloginfo('rss_url'),301); 
    106?> 
     7 No newline at end of file 
  • wp-rss2.php

     
    11<?php 
     2define('WP_USE_THEMES', false); 
     3require('./wp-blog-header.php'); 
    24 
    3 if (empty($wp)) { 
    4         require_once('wp-config.php'); 
    5         wp('feed=rss2'); 
    6 } 
    7  
    8 require (ABSPATH . WPINC . '/feed-rss2.php'); 
    9  
     5wp_redirect(bloginfo('rss2_url'),301); 
    106?> 
     7 No newline at end of file