Forum Moderators: phranque
One thing that I thought I would try is to redirect the feed on my site to my FeedBurner feed. Hopefully, then, only FeedBurner will be accessing it and any other reader will get it from FeedBurner. I'm not sure if this will accomplish anything, but I want to try it temporarily. Please look at my code and let me know if it will work:
#Redirect RSS 2.0 template to FeedBurner feed
RewriteCond %{HTTP_USER_AGENT} !^Feedfetcher-Google [NC,OR]
RewriteCond %{HTTP_USER_AGENT} !^FeedBurner [NC]
RewriteRule ^blog/rss_2.0[/]?$ [feeds.feedburner.com...] [R=302,L]
The idea is to redirect any request that is made by anybody other than the Google or FeedBurner bots. At first, I was just going to try the RewriteRule, but then I realized (correctly, I think) that FeedBurner would get redirected back to itself, which would be counterproductive. So I added the user-agent checks.
Any ideas would be appreciated.
[/]? can be simplified to /? If I am thinking straight, then the [OR] will make it fail for every user. Remove it. You want the "UA to block" to not be any of them.
.
You can test this code out very easily.
Temporarily, set the "blocked" user agent in the .htaccess file to be something that your browser will send, and try to access the URL.
It should block you.
I've been using the user-agent switcher add-in for Firefox a lot lately, but I didn't think to test this with it.
Thanks!
Edit: Tested and it seems to work. Should I use the 302 redirect (since I was thinking of making this temporary), or should I make it a 301?
The 301 would tell those bots to go elsewhere, and not come back here - but they probably don't cache the status of URLs anyway.
The 302 tells the bot to go elsewhere, but to keep checking the status of the requested URL from time to time, so they will always try again.