Options +FollowSymlinks
RewriteEngine On
# no redirecting of actual files
# RewriteCond %{REQUEST_FILENAME} !-f
# force www. before domain.com
# RewriteCond %{HTTP_HOST} !^(www.([^/]+)$) [NC]
# RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# add closing slash if missing to prevent apache errors
RewriteCond %{REQUEST_URI} !([^.]+)/$
RewriteRule ^([^.]+)$ %{REQUEST_URI}/ [L,R=301]
# redirect to sitemap
RewriteRule ^/?sitemap.xml$ ww_view/sitemap-xml.php [L]
# redirect to robots.txt
RewriteRule ^/?robots.txt$ ww_view/robots.php [L]
# extra security to protect files in ww_edit section
RewriteRule ^/?ww_edit/!(index.php)([^.]+)?$ ww_view/index.php [L]
RewriteRule ^/?ww_edit/_blocks/(.*)$ ww_view/index.php [L]
RewriteRule ^/?ww_edit/_chunks/(.*)$ ww_view/index.php [L]
# leave ww_edit/_snippets visible otherwise admin popups get screwed
# no need to hide ww_edit/css
#redirect all other URLs to ww_view/index.php for PHP processing
# use a slightly different request if we're attempting a download
RewriteRule ^/?download/(.*)/(.*)$ ww_view/index.php [L]
# otherwise use the following which filters out filenames
RewriteRule ^/?([^.]+)?$ ww_view/index.php [L]
AddHandler php5-script .php