SES URLs in MangoBlog on Tomcat

My live blog site runs on ColdFusion (using JRun) with the SES servlet mappings in web.xml. I use the excellent MangoBlog engine for powering my blog. All this means that I have pretty-ish URLs like

Today I wanted to run a copy of my blog on a dev box. But on that dev box, I chose to use JBoss-Tomcat. And the SES servlet mappings that work in ColdFusion on JRun, do NOT work on ColdFusion on Tomcat-JBoss as they are not supported by the servlet engine.

To get around it, I simply used Apache-based rewrites so that the SES urls like automatically get mapped to

Here are the rewrites that I put in place to get posts, categories, pages and search to work.

<VirtualHost *:80 >
ServerName nagpals.local
RewriteEngine On
RewriteOptions Inherit
RewriteRule ^/blog/post.cfm/(.*)$1 [P,L]
RewriteRule ^/blog/page.cfm/(.*)$1 [P,L]
RewriteRule ^/blog/archives.cfm/search/(.*)$1 [P,L]
RewriteRule ^/blog/archives.cfm/category/(.*)$1 [P,L]
RewriteRule ^/(.*)$1 [P,L]
ProxyPassReverse /
ProxyPreserveHost on

This would be useful for another reason. If you use MangoBlog on Railo running on JBoss/Resin with Apache in front, you can employ the same trick to get around the whole issue of SES URLs.

8 thoughts on “SES URLs in MangoBlog on Tomcat”

  1. Doesn’t mango do this out of the box, the same way BlogCFC does?
    The mapping tool would be useful for removing the “page.cfm” completely, but not sure how this would be handled in Mango, as they have multiple front controllers (page.cfm,archives.cfm etc)

    When I did the presentation to the CFUG last month I didn’t have to do any mapping stuff to get the /page.cfm/page-name to work…

Comment on this blog post...