RewriteEngine on

RewriteRule ^/$ /lf/ [R]

RewriteRule ^/lf/static/(.*)$ /lf/static/$1 [L,PT]

RewriteCond %{QUERY_STRING} (.*)?
RewriteRule ^/lf/$ /lf/webmcp-wrapper.lua?_webmcp_urldepth=0&_webmcp_module=index&_webmcp_view=index&%1 [PT]

RewriteCond %{QUERY_STRING} (.*)?
RewriteRule ^/lf/([^/]+)/$ /lf/webmcp-wrapper.lua?_webmcp_urldepth=1&_webmcp_module=$1&_webmcp_view=index&%1 [PT]

RewriteCond %{QUERY_STRING} (.*)?
RewriteRule ^/lf/([^/]+)/([^/\.]+)$ /lf/webmcp-wrapper.lua?_webmcp_urldepth=1&_webmcp_module=$1&_webmcp_action=$2&%1 [PT]

RewriteCond %{QUERY_STRING} (.*)?
RewriteRule ^/lf/([^/]+)/([^/\.]+)\.([^/]+)$ /lf/webmcp-wrapper.lua?_webmcp_urldepth=1&_webmcp_module=$1&_webmcp_view=$2&_webmcp_suffix=$3&%1 [PT]

RewriteCond %{QUERY_STRING} (.*)?
RewriteRule ^/lf/([^/]+)/([^/]+)/([^/\.]+)\.([^/]+)$ /lf/webmcp-wrapper.lua?_webmcp_urldepth=2&_webmcp_module=$1&_webmcp_view=$2&_webmcp_id=$3&_webmcp_suffix=$4&%1 [PT]

Alias /lf/static /var/lib/liquid_feedback_frontend/static

ScriptAlias /lf/ /usr/lib/webmcp/framework/cgi-bin/

<Directory "/var/lib/liquid_feedback_frontend/static">
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>

<Directory "/usr/lib/webmcp/framework/cgi-bin">
  AllowOverride None
  Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
  Order allow,deny
  Allow from all
</Directory>

<Location /lf>
  SetEnv WEBMCP_APP_BASEPATH '/var/lib/liquid_feedback_frontend'
</Location>
