01.28.07

POW 0.0.9 preview available

Posted in POW at 7:38 pm by David Kellogg

POW 0.0.9 preview is available. It is there if you want to see any next-gen features. Rewrite rules were added. Rewrite rules allow you to rewrite urls on the fly. Most server admins know this through ‘.htaccess’. Here is the new functionality in action.

// htdocs/system/startup.sjs
<?sjs
 pow_server.REWRITE_RULES =
  [
   [ "dog/?(.*)$", "/cat.sjs?q=$1" ],
   [ /^\/Jason\/?(.*)$/i, "/cat.sjs?q=$1" ]
  ];
?>

This results in dog.html pointing to /cat.sjs?q=.html. This cleans up the problem of linking many fake directories to a single script.

Leave a Comment