2012-08-27 119 views
0

在一個WordPress站點上: 我試圖阻止一個特定的「sub」訂閱源重定向到feedburner,但我想允許主要訂閱源繼續重定向。阻止特定RSS訂閱源重定向到feedburner,但讓主訂閱源重定向

飼料我想,以防止對重定向是設置這樣的: http://website-example.org/feed?author=275

,但保持http://website-example.org/feed重定向到Feedburner的。

目前我正在使用PHP創建重定向。我的代碼看起來是這樣的:

add_filter('feed_link','custom_feed_link', 1, 2); 

function custom_feed_link($output, $feed) { 
    $feed_url = 'http://feeds.feedburner.com/websitename/yaSQ'; 
    $feed_array = array('rss' => $feed_url, 'rss2' => $feed_url, 'atom' => $feed_url, 'rdf' => $feed_url, 'comments_rss2' => ''); 
    $feed_array[$feed] = $feed_url; 
    $output = $feed_array[$feed]; 

return $output; 

}

我發現這個答案在這裏,但我不知道這是否是做到這一點的最好辦法。 (也,我不完全理解它的代碼。) How to redirect main all feed to feedburner except some feeds?

有人能告訴我,如果我在正確的軌道上,或者如果有這個一個簡單的解決方案,或者是什麼的.htaccess代碼上面的鏈接意味着。

謝謝 伊恩

回答

0

解決它。

我最終使用了一個自定義RSS模板和一個名爲「feed wrangler」的舊插件。 該解決方案運行良好。

下面是一些有用的鏈接: http://wordpress.org/extend/plugins/feed-wrangler/ http://kanevski.org/projects/feed-wrangler/