Separate Feedburner feeds and categories feeds using .htaccess

It started out as a request to Patrix to give me a feed that was separate from his one liner asides. The problem was that every time I added his feed to my reader, his one liner posts took over most of the items in my reader. And since I don’t use feed readers [Why? Its a topic of another post], and prefer to use a feed widget on my block, more often than not I would find that there were more one liners than posts by others. However as mails with Patrix revealed, separating the feeds is not a simple thing to if you use feedburner as your primary feed.

That led me to delve into some research about how to accomplish this. I wanted the main feed to be unharmed by feedburner, and yet find a way to provide a separate feed based on what my readers could ask for. A couple of options were available – Permalink redirector plugin nearly did what I wanted it to do, and Feedburner category just about fell short.

Enter mod_rewrite. I stumbled upon this as I was doing a bit of research, and hit upon some excellent posts here and here. [Please do read those posts before going ahead as they are excellent source of information] I had done some work on rewrites a while back in my last job, so it wasn’t difficult to figure out what was done. And with a few little tweaks, voila, i don’t need any plugin (Feedburner or Permalink) to redirect my feed to feedburner. At the same time, I can give out any selective feed based on categories to my readers.

How did I do that? Simple – just by adding the following line of codes at the very top of the .htaccess file. The .htaccess file resides in the root directory of your wordpress install. For example, if your wordpress install was located at www.mydomain.com/wp/ then your .htaccess would reside in wp directory.

Here’s what I put at the top of my .htaccess file:


RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} !FeedBurner
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/stupendousman [R,L]
RewriteRule ^feed=rss2&cat=-269/?$ https://stupendous.blog/?feed=rss2&cat=-269 [R,L]

What does this say?

Simple – the third and fourth line simply say that if the user agent accessing your site is not feedburner, and if it is looking for a feed, then simply redirect it to feedburner. For example, if i type in https://stupendous.blog/feed/ then i will be redirected to feedburner feed for me. To make it work on your site, simply substitute my website for yours 🙂

The next line is more interesting.

RewriteRule ^feed=rss2&cat=-269/?$ https://stupendous.blog/?feed=rss2&cat=-269 [R,L]

I define another rewrite condition which simply says, if anybody comes looking for a feed without my slugs category (which is id=269), then instead of redirecting to feedburner, keep the original feed. By having a negative sign in “&cat=-269”, I assure that all categories except Slugs is added as a part of the feed.

Thats it! By using the simple rewrites I can keep adding or modifying the type of feeds based on what my readers request. For example, If somebody wanted my reviews feed, then I would simply add another line like:

RewriteRule ^feed=rss2&cat=29/?$ https://stupendous.blog/?feed=rss2&cat=29 [R,L]

Where cat=29 indicates my Reviews feed.

There are some caveats with the approach though. If you have a post in more than one category, and you chose to exclude the category, then the post in that category is excluded, even if it was a part of another category. I have not found a work around for this – if you find any, let me know. At some point I want to mix and match feeds from different categories. I am pretty sure it can be done, I just haven’t invested that time in it. When i do, I will let you know 🙂

I wish somebody expanded on this idea and made it into a wordpress plugin – it would be the most useful!

And please don’t forget to keep a backup of your .htaccess file!!

Added a Captcha!

This was long coming. Though I have been toying with idea of captcha for long, I only could do it now. Anyways, the captcha is a simple question – and hopefully, you my dear readers know the answer. Now with combination of Akismet and Captcha, I will reduce the number of spam comments on my website.

By the way, if you get the answer wrong… may the dark lord help you!

At last!

A theme change worth keeping! I have been so tired about changing the themes again and again and reverting to back I had. This is the closest theme I have come to like, in majority because it so well written and modifying it was a piece of cake!! This theme shall stay – a few minor updates may occur, but I like this theme!!

Back

I just can’t seem to sit tight on any theme. Maybe I just like the way my theme looks and feels – I personally feel that all that I need are in the right places in my theme – There is a lot of scope for visual enhancements, but overall, I like the way my theme looks. I think I am going to stick with it for a while.

Theme Change

Of all the new themes that I have tried out in the last couple of weeks, I have to admit, this is the best one of the lot I have liked. I am going to put it up for a few days – maybe study the code a bit and see if I can get all my usual stuff on this one…. it should be interesting 🙂 – keep you posted!!!

New Look, Anyone?

Ever since the Jedi told me that the current theme has been my longest running theme, and how its gone fat, I have been thinking about it quite seriously.

And I think he’s right – This theme has gone stale.I developed it months ago and it is now looking aged. I like the overall structure of this theme and where each should be, but i have a serious problem with the colors and overall look and feel.

I know I could do the improvising myself, but I find myself with absolute lack of time and too many things to do in my offline life.

So here’s calling all you web wizards out there! Help me! Tell me how should I improve this theme? Like the overall look, the colors, the font size etc etc.

I am bundling a 25$ Amazon Gift Certificate to anyone who can come up with a nice looking eye pleasing template based on the theme I have presently.

The things that I am looking for are specifically:

  • The template / look should be neat and clean. This and this are very gaudy in my opinion, while this is too simplistic for my taste. My tastes would be somewhere along lines of this or this (2 thumbs way up!), the latter being one of my personal favorites in the way the whole site is laid out, it being colors, font size et al. This would also classify as an excellent clean look.

  • I do not necessarily hate the way my website looks. I do know it is too blocky in nature. It does require cleaning up and structuring content properly. Hence, I don’t care where blocks go and live, but I did like to keep the current blocks in the layout.

  • No rounded corners / nifty corners or rounded edges. A little bit of Ajax may be fine :). I hate clutter on websites, and I certainly dislike websites which take more than 1 second to load. So it has to be light.

  • No photo streams of flickr etc. I like the rotating banner photo above, but thats about it.

Other than this, I have no serious qualms about the layout – use your imagination – feel free to move stuff around! But whatever it is, it should be clean and very eye pleasing!!

PS: I am technically competent with CSS and PHP, hence I am not expecting you to make a “theme” for me. I am just looking for the standard CSS, and the look and feel template of the site (perhaps a PSD, JPG or BMP files big enough, nicely labeled :)).

What are you waiting for – a 25$ Amazon Gift Certificate awaits you!!

Simplicity is the key

As you notice, there is a subtle change in my theme today. Its gone back to 800px width, and I have got rid of the sidebars. They were too “sidey” :D.

Nonetheless, I am begining to believe, based on my own preferences and perception, that Simplicity is the key. Hence this change to theme.

You come here. You read what’s latest. You scrawl down, and if you are interested you click on tags and see their respective archives. Really, that is all is required!

From now on, for couple of weeks expect some “simplicity” being thrown in. 🙂

Comments, brickbats welcomed 😀