How to redirect RSS feeds to Feedburner and keep pretty permalinks?

There are many tutorials out there, but all of them give you the same code snippet. I put it into my htaccess file, but the feeds are not being redirected.

I don't want to use a plugin.

I'm sure the code works. I need to figure out why it doesn't work for me. Here's part of my code:

# BEGIN WordPress
IfModule mod_rewrite.c
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


# temp redirect wordpress content feeds to feedburner
 RewriteEngine on
 RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]
 RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
 RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/ZoomingJapan [R=302,NC,L]
/IfModule

#Prevent directory indexing
Options -Indexes

# END WordPress

Topic feedburner rss permalinks htaccess Wordpress

Category Web


The rules for Feedburner should come before the WordPress rules. And activate the rewrite engine just once. That’s enough. :)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_USER_AGENT} !FeedBurner    [NC]
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/ZoomingJapan [R=302,NC,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.