horsewell/suar-cms/master/.htaccess - Htaccess File

horsewell/suar-cms/master/.htaccess

#
# Apache/PHP/Drupal settings:
#

# set the server timezone
SetEnv TZ Australia/Perth

# set the server administrator email
#SetEnv SERVER_ADMIN support@suarstudios.com

# Protect files and directories from prying eyes.
<FilesMatch ".(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(.php)?|xtmpl|svn-base)$|^(code-style.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format|txt)$">
  Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Make Drupal handle any 404 errors.
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php

# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
  # There is no end quote below, for compatibility with Apache 1.3.
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

# Set the default handler.
DirectoryIndex index.php

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On

  # Cache all files for 2 weeks after access (A).
  # ExpiresDefault A1209600

  <FilesMatch .php$>
    # Do not allow PHP scripts to be cached unless they explicitly send cache
    # headers themselves. Otherwise all scripts would have to overwrite the
    # headers set by mod_expires if they want another caching behavior. This may
    # fail if an error occurs early in the bootstrap process, and it may cause
    # problems if a non-Drupal PHP file is installed in a subdirectory.
    ExpiresActive Off
  </FilesMatch>
</IfModule>

<IfModule mod_rewrite.c>
  RewriteEngine on

  # Set "protossl" to "s" if we were accessed via https://.  This is used later
  # if you enable "www." stripping or enforcement, in order to ensure that
  # you don't bounce between http and https.
  RewriteRule ^ - [E=protossl]
  RewriteCond %{HTTPS} on
  RewriteRule ^ - [E=protossl:s]

  RewriteCond %{HTTP_HOST} !^(backdrop|m|test|dev)?.?suarstudios.com$ [NC]
  RewriteCond %{HTTP_HOST} suarstudios.com$ [NC]
  RewriteRule ^(.*)$ http%{ENV:protossl}://suarstudios.com%{REQUEST_URI} [L,R]

  # Rewrite URLs of the form 'x' to the form 'index.php?page=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
</IfModule>

On Github License

Files

Download PDF of Htaccess file
ENV, HTTP_HOST, HTTPS, protossl, REQUEST_FILENAME, REQUEST_URI, SERVER_ADMIN, TZ

Comments

Apache