DirectoryIndex index.py
#AddHandler cgi-script-debug .py
RewriteEngine off
# In .htaccess, mod_rewrite loops over the file when it hits an
# "L" flag. This rule prevents it.
RewriteCond %{ENV:REDIRECT_STATUS} =200
RewriteRule ^ - [L]
# Spiff's web/ folder is directly accessible.
RewriteCond %{REQUEST_URI} ^/web/.*$
RewriteRule ^ - [L]
# Spiff's data/repo/ folder is also directly accessible.
RewriteCond %{REQUEST_URI} ^/data/repo/.*$
RewriteRule ^ - [L]
# By default, refer anything so that the path is passed through the
# page argument. Exception: The installer/ directory.
RewriteCond %{REQUEST_URI} !.*installer/.*$
RewriteRule ^(.*)/$ index.py?page=$1 [QSA,L]