Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

From my old static website, I want to preserve some URLs like the RSS Feed one. My feed URL is and I want to redirect it to the category feed URL WITHOUT 301 redirect.

So I tried it via .htaccess file first, what is not working. Then I tried via internal Wordpress URL rewrite system.

So first I did this:

// Rewrite actulaite-russe.xml
function feed_dir_rewrite( $wp_rewrite ) {
    $feed_rules = array(
        'actualite-russe.xml' => 'index.php?cat=8&feed=rss2',
        'actualite-russe.rdf' => 'index.php?cat=8&feed=rdf' . $wp_rewrite->preg_index(1)

    $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
    return $wp_rewrite->rules;

// Hook in.
add_filter( 'generate_rewrite_rules', 'feed_dir_rewrite' );

That give me a 301 redirect from to
I don't want any 301 redirect I want just been delivered my feed without redirect. So I tried this:

function feed_dir_rewrite(){

That gives me exactly the same result as the previous code.

So how can I disable the 301 redirect for these functions?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.