MINISTRYGmbH/morrow-docs/master/.htaccess - Htaccess File

MINISTRYGmbH/morrow-docs/master/.htaccess

RewriteEngine on
  # RewriteBase /

  # Rewrite "domain.com -> www.domain.com
  # -------------------------------------
  # RewriteCond %{HTTPS} !=on
  # RewriteCond %{HTTP_HOST} ^www.domain.com$
  # RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

  # Rewrite "www.domain.com -> domain.com
  # -------------------------------------
  # RewriteCond %{HTTPS} !=on
  # RewriteCond %{HTTP_HOST} ^www.domain.com$
  # RewriteRule ^(.*)$ http://tau-mal-auf.de/$1 [R=301,L]

  # force SSL for all files
  # -----------------------
  # RewriteCond %{SERVER_PORT} !^443$
  # RewriteCond %{HTTP_HOST} ^www.domain.com$
  # RewriteRule (.*)  https://%{SERVER_NAME}%{REQUEST_URI} [L]

  # Maintenance mode
  # -------------------
  # RewriteCond %{REMOTE_ADDR} !x.x.x.x
  # RewriteRule !(maintenance.htm|.+.(gif|jpg|css)) /maintenance.htm [R]

# Map request to index.php if the file was not found
# ---------------------------------------------------------------------------------------------
RewriteRule ^([a-z0-9-/]*)$ index.php?morrow_path_info=$1&morrow_basehref_depth=1 [L,QSA,NC]

# Map all requests to the public subfolder (also features public folder)
# ---------------------------------------------------------------------------------------------

#TODO: For example, composer.json can be viewed by the user though its not in any public module folder.
RewriteCond %{REQUEST_URI} !/modules/.+?/public/.+
RewriteRule ^(.+?)/(.+)$ modules/$1/public/$2 [L,QSA]

# Prevent directory listing
# ---------------------------------------------------------------------------------------------
Options -Indexes

# Deflate static ressources
# ---------------------------------------------------------------------------------------------
<Ifmodule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
  AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
  AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
</IfModule>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, HTTP_HOST, HTTPS, REMOTE_ADDR, REQUEST_URI, SERVER_NAME, SERVER_PORT, static

Comments

Apache