RewriteEngine On

# reserve XE Layout Template Source File (*.html)
RewriteRule ^(layouts|m.layouts)/(.+)\.html$ - [L,F]
# reserve XE Template Source Files (*.html)
RewriteCond %{REQUEST_URI} !/modules/editor/
RewriteRule /(skins|m.skins)/(.+)\.html$ - [L,F]

# conf, query, schema
RewriteRule ^(modules|addons|widgets)/(.+)/(conf|queries|schemas)/(.+)\.xml$ ./index.php [L]

# static files
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)/files/(member_extra_info|attach|cache|faceOff)/(.*) ./files/$2/$3 [L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)/(files|modules|widgets|widgetstyles|layouts|m.layouts|addons)/(.*) ./$2/$3 [L]

# router
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php [L]
