Redirecting WordPress category feeds containing non-latin characters to Feedburner

Today I was playing with my feeds. I wanted to redirect the category feeds to feedburner. I couldn’t find any plugin that can do the job well because a have a lot of categories and had to create manually a feed in feedburner for each of them. The main problem is that I have multilingual content and my categories have slugs in Bulgarian. Upto now I had feedburner feeds just for the whole content on the blog in Bulgarian and English. I am using .htaccess that redirects my feeds to feedburner like this:

# bg feeds
RewriteCond %{HTTP_USER_AGENT} !^(FeedBurner|FeedValidator) [NC]
RewriteRule ^bg/feed/?$ [R=302,NC,L]

# en feeds
RewriteCond %{HTTP_USER_AGENT} !^(FeedBurner|FeedValidator) [NC]
RewriteRule ^feed/?$ [R=302,NC,L]

But now I had to include the category matching which has non-latin characters. This would not work so I had to do it via PHP. I then realized that the same thing can be achieved with the help of one of those plugins for redirects in WordPress. However this is the better way for me. Here it is:


$configRedirects = array(
 '/bg/category/програмиране/feed/' => '',
 '/bg/category/програмиране/php-програмиране/feed/' => '',
 '/bg/category/програмиране/php-програмиране/codeigniter-php/feed/' => '',
 '/bg/category/програмиране/php-програмиране/prado-php/feed/' => '',
 '/bg/category/програмиране/php-програмиране/wordpress-php-програмиране/feed/' => '',

 '/category/programming/feed/' => '',
 '/category/programming/php/feed/' => '',
 '/category/programming/php/codeigniter/feed/' => '',
 '/category/programming/php/prado/feed/' => '',
 '/category/programming/php/wordpress/feed/' => '',

$decodedUrl = urldecode($_SERVER['REQUEST_URI']);

if(!eregi("FeedBurner|FeedValidator", $_SERVER['HTTP_USER_AGENT']) && $configRedirects[$decodedUrl])
 header('Location: '.$configRedirects[$decodedUrl]);

This post is also available in: Bulgarian

  1. Both S Voice and Moto Voice have the ability to set up your own custom hotwords for detection. This is a lot of fun because if you’re just using Google Now then you are stuck with using ‘OK Google’ as your hotword.

  2. It would then have to create an FBI forensics laboratory on site at its headquarters and staff it. The burden would then extend to what Apple views is the inevitable onslaught of additional devices that would follow after the precedent was set.

  1. No trackbacks yet.