justincawthorne/Wicked-Words/master/.htaccess - Htaccess File


#compress files

  <IfModule mod_deflate.c>
    <FilesMatch ".(css|js|x?html?|php)$">
      SetOutputFilter DEFLATE

# set Expire headers

  <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 seconds"
    ExpiresByType image/x-icon "access plus 2592000 seconds"
    ExpiresByType image/jpeg "access plus 2592000 seconds"
    ExpiresByType image/png "access plus 2592000 seconds"
    ExpiresByType image/gif "access plus 2592000 seconds"
    ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
    ExpiresByType text/css "access plus 604800 seconds"
    ExpiresByType text/javascript "access plus 216000 seconds"
    ExpiresByType application/javascript "access plus 216000 seconds"
    ExpiresByType application/x-javascript "access plus 216000 seconds"
    ExpiresByType text/html "access plus 600 seconds"
    ExpiresByType application/xhtml+xml "access plus 600 seconds"

# set Cache-Control Headers

  <IfModule mod_headers.c>
    <FilesMatch ".(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "max-age=2592000, public"
    <FilesMatch ".(css)$">
    Header set Cache-Control "max-age=604800, public"
    <FilesMatch ".(js)$">
    Header set Cache-Control "max-age=216000, private"
    <FilesMatch ".(x?html?|php)$">
    Header set Cache-Control "max-age=600, private, must-revalidate"

# Turn ETags Off

  <IfModule mod_headers.c>
    Header unset ETag
  FileETag None

# unset Remove Last-Modified Header

  <IfModule mod_headers.c>
    Header unset Last-Modified

# start redirect process

  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 index.php to assembler.php

  RewriteRule ^/?index.php$ ww_view/assembler.php [L]
# redirect to robots.txt

  RewriteRule ^/?robots.txt$ ww_view/robots.php [L]
# redirect to sitemap

  RewriteRule ^/?sitemap.xml$ ww_view/sitemap-xml.php [L]
# extra security to protect files in ww_edit section
  RewriteRule ^/?ww_edit/!(admin.php)([^.]+)?$ ww_view/admin.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/assembler.php for PHP processing  
  # use a slightly different request if we're attempting a download
  RewriteRule ^/?download/(.*)/(.*)$ ww_view/assembler.php [L]
  # otherwise use the following which filters out filenames
  RewriteRule ^/?([^.]+)?$ ww_view/assembler.php [L]
AddHandler php-legacy .php

On Github License


Download PDF of Htaccess file