Im using Feedburner and have my WordPress feeds redirected. I want to add an exception for the Yahoo Pipes 2.0 user agent but the user agent string contains spaces. When I put quotes around it I get an apache config test fail.
Here are the rules.
# BEGIN Feedburner
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(feed|wp-atom|wp-feed|wp-rss|wp-rdf|wp-commentsrss)(.+)\ HTTP/ [NC,OR]
RewriteCond %{QUERY_STRING} ^feed [NC]
RewriteCond %{HTTP_USER_AGENT} !^(FeedBurner|FeedValidator) [NC]
RewriteCond %{HTTP_USER_AGENT} !^"Yahoo Pipes 2.0" [NC]
RewriteRule .* http://feeds.feedburner.com/xxxxxxx [R=307,L]
</IfModule>
# END Feedburner
Here is the error I get when I try to reload apache. Also the rules are in the vhost because I am using WordPress multi site and if I put it in .htaccess all my sites feeds would be redirected to this sites Feedburner.
Syntax error on line 46 of /etc/apache2/sites-enabled/xxxxxxx:
RewriteCond: bad flag delimiters
Action 'configtest' failed.
The Apache error log may have more information.
failed!
I figured it out and I am leaving the answer here.
The HTTP_USER_AGENT condition checks for a match of any of the words so I only needed to add Yahoo instead of "Yahoo Pipes 2.0".
The correct rules are: