WPMU fedburner redirects via htaccess

Hello,

I would like to setup to redirect feeds of wmpu webs to feedburner. I found nice advice to do thet with htaccess.

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
RewriteRule ^feed/?([_0-9a-z-] )?/?$ http://feeds.feedburner.com/wpbeginner [R=302,NC,L]
</IfModule>

But it is only for single wp, is it?

Can you help me how to setup if I have more webs on wpmu?

Is this right? Example of redirection of main web and subdomain?

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]
RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
RewriteRule ^domain.com/feed/?([_0-9a-z-] )?/?$ http://feeds.feedburner.com/domain [R=302,NC,L]
RewriteRule ^sub.domain.com/feed/?([_0-9a-z-] )?/?$ http://feeds.feedburner.com/sub-domain [R=302,NC,L]
</IfModule>

Thanks,

Bigdrobek

  • atouchofsummer
    • Site Builder, Child of Zeus

    Since it’s likely that Feedburner will be in the next batch of services Google kills off, you might want to hold off on that transition, or find another feed service.

    One solution I found for feeds was woefully sub-par for podcast feeds, so we’ve got a two-service solution for our needs now.

    Alas, I cannot help with the .htaccess verification, since I have not yet played with Multisite myself, although I did find this WPMU thread: Redirect FeedBurner Feeds via .htaccess in MultiSite

  • Vaughan
    • Support/SLS MockingJay

    hiya

    thanks for the post. further to what @atouchofsummer said.

    your rule is slightly wrong

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]
    RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
    RewriteRule ^domain.com/feed/?([_0-9a-z-] )?/?$ http://feeds.feedburner.com/domain [R=302,NC,L]
    RewriteRule ^sub.domain.com/feed/?([_0-9a-z-] )?/?$ http://feeds.feedburner.com/sub-domain [R=302,NC,L]
    </IfModule>

    sub could be any name. so you need regex there.

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]
    RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]
    RewriteRule ^domain.com/feed/?([_0-9a-z-] )?/?$ http://feeds.feedburner.com/domain [R=302,NC,L]
    RewriteRule ^([a-z0-9-]+).domain.com/feed/?([_0-9a-z-] )?/?$ http://feeds.feedburner.com/sub-domain [R=302,NC,L]
    </IfModule>

    not used feedburner so not sure what sub-domain is, if it’s = to sub then might need a $1 or something.

    hope this helps.

  • Vaughan
    • Support/SLS MockingJay

    hiya

    that’s why I asked about sub-domain in the feedburner url. if sub-domain is the same as sub.

    if sub-domain is actually different, then you’ll need to hardcode, like you did previously.

    but if they are both the same.

    ie.

    subsite1.example.com redirects to http://feeds.feedburner.com/subsite1

    then you could use something like

    RewriteRule ^([a-z0-9-]+).domain.com/feed/?([_0-9a-z-] )?/?$ http://feeds.feedburner.com/$1 [R=302,NC,L]

    i’m not an expert with htaccess. but the $1 should then be substituted by whatever was used for sub.domain.com

    hope this helps.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.