Latest Entries »

MassWrestling.com gets about 90k requests to its RSS feeds every month, which eats up about 3GB of bandwidth transfers and puts extra load on the web server.

I saw a tip on Coding Horror Blog that it is a great idea to rewrite your RSS feeds to be syndicated by Feedburner. Unfortunately, the example given doesn’t quite work for MassWrestling.com’s e107 feed URLs:

/cms/e107_plugins/rss_menu/rss.php?forumposts.2

So I spent some time relearning Apache’s mod_rewrite, and came up with the following lines to add to my .htaccess files:

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} !FeedBurner
RewriteCond %{QUERY_STRING} ^forumposts\.1$
RewriteRule ^rss\.php$ http://feeds.feedburner.com/masswrestling/posts_rss? [R=301]

This rewrite sends all requests that are not FeedBurner’s http agent to Feedburner’s copy of my feed. The problem was figuring out that the question mark after the rss.php? is actually not matchable in the RewriteRule condition. Instead, you have to match it in a RewriteCond against the %{QUERY_STRING} variable. The replacement pattern requires a question mark at the end of it to ensure that mod_rewrite does not pass on the extra paremeters to the new URL.

So now:

rss.php?forumposts.2

redirects (301, permanently moved) to:

http://feeds.feedburner.com/masswrestling/posts_rss2

Let’s hope it knocks out the extra RSS traffic I have.

Firefox can’t DOEY!

If you are writing an XSL for some particular XML data you have to be outputted into HTML, you may run into a problem when you view your XML data with your XSL transformation applied to it in Firefox. The reason for this is because the Firefox developers have chosen not to implement part of the XSLT specification for disable-output-escape (DOEY).

To get around this, one must make quite a bit of changes to their XSL to accomodate Firefox. This smells alot like what alot of people have to do often for MSIE, except with Firefox being the ugly one this time.

Click to see my example XSL sheet below for a rough reference on how this can be achieved.

View full article »

Powered by WordPress | Theme: Motion by 85ideas.