RewriteEngine On

# map phocoa framework wwwroot - enabled PHOCOA Versioning
RewriteRule ^/?www/framework(/[0-9\.]+)/?(.*) /www/framework/$2 [L]

#enable a normal wwwroot
RewriteRule ^/?www/?(.*) - [L]

# enable www access to skin assets
# security thought... can people ../../.. their way to trouble? Apache 2 at least seems to prevent this, but I am not sure how.
# skinTypeAssetsDir
RewriteRule ^/?skins/([^/]*)/www/?(.*) ##PHOCOA_APP_DIR##/skins/$1/www/$2 [L]
# skinSharedAssetsDir and skinThemeAssetsDir
RewriteRule ^/?skins/([^/]*)/([^/]*)/([^/]*)/?(.*) /www/skins/$1/$2/www/$3/$4 [L]

# show phpdoc documentation
RewriteRule ^/?docs$ /docs/ [R,L]
RewriteRule ^/?docs/?(.*) /www/docs/$1 [L]

# allow / to run application - THIS ONE MUST BE LAST otherwise it will override the others!
RewriteRule ^/?index.php.* - [L]
RewriteRule ^/?(.*) /index.php/$1
