Placing a Gantry controller at the base location

May 25 2008 1:57 p.m.

Sometimes you want to place a Gantry controller at the base location ( "/" ) of your web server, but you don't want it to execute for every image, js, css, etc. A simple solution is to short circuit the dispatching by using LocationMatch and adding the exclusions.

For example, this configuration sets a controller at the base location. However, the controller will not get triggered when requests come in that start with "/Apps-Blogger". This works great for me since I have all my static content located in /Apps-Blogger

<LocationMatch ^/(?!Apps-Blogger)>

  PerlSetVar GantryConfInstance blogger_prod
  PerlSetVar GantryConfFile /etc/gantry.conf

  SetHandler  perl-script
  PerlHandler Apps::Blogger

</LocationMatch>
Post a comment

use the force, Luke