# Protect files and directories from prying eyes.

# Directories are final path only, not between.
<FilesMatch "(\.(inc|sh|txt|tpl|backup|test|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.orig\.save)$|deleted|backup|vendor|config)[^config_client\.js|make_backup\.js]">
	<IfModule mod_authz_core.c>
		Require all denied
	</IfModule>
	<IfModule !mod_authz_core.c>
		Order allow,deny
	</IfModule>
</FilesMatch>

# Browser caching FileETag control
# <FilesMatch ".+\.(js|css)$">
# 	# Set FileETag looking MTime and size to allow detect changes on js and css files
# 	# @see https://stackoverflow.com/questions/13215213/how-do-i-configure-etags
# 	FileETag All
# 	# FileETag INode,
# 	# FileETag MTime,
# 	# FileETag Size,
# 	# FileETag INode MTime,
# 	# FileETag INode Size or
# 	# FileETag MTime Size may also be set.
# 	# FileETag All
# 	# Remove ETag optional way
# 	# Header unset ETag
# 	# FileETag none
# 	# Header set Cache-Control "public, must-revalidate, max-age=3600"
# 	# Header unset ETag
# </filesMatch>

# Deny paths final and between
# RewriteEngine On
# RewriteRule (config) - [F,L]

# <FilesMatch ".(eot|ttf|otf|woff|woff2)">
#   Header set Access-Control-Allow-Origin "*"
# </FilesMatch>

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

# Set the default handler.
<IfModule dir_module>
	DirectoryIndex index.html index.php
</IfModule>

# Various header fixes.
# <IfModule mod_headers.c>
	# Disable content sniffing, since it's an attack vector.
	# Header always set X-Content-Type-Options nosniff
	# Disable Proxy header, since it's an attack vector.
	# RequestHeader unset Proxy

  # PRODUCTION
  # Set cache files for one week 3600 * 24 * 7 = 604800
  # Header set Cache-Control: stale-while-revalidate=604800

  # DEVELOPMENT
  # <If "%{HTTP_HOST} =~ /(127\.0\.0\.1.+|localhost.+)$/">
	#  Header set Cache-Control: "no-store, max-age=0"
	#  Header unset ETag
  # </If>
# </IfModule>

# re-direct old v5 paths to the new ones
<IfModule mod_rewrite.c>
	# str_manager
	RewriteRule ^lib/dedalo/extras/str_manager/$ core/extras/str_manager/ [NS,L]
</IfModule>
