##RewriteEngine On
##
### The following rule tells Apache that if the requested filename
### exists, simply serve it.
##RewriteCond %{REQUEST_FILENAME} -s [OR]
##RewriteCond %{REQUEST_FILENAME} -l [OR]
##RewriteCond %{REQUEST_FILENAME} -d
##RewriteRule ^.*$ - [L]
##
### The following rewrites all other queries to index.php. The
### condition ensures that if you are using Apache aliases to do
### mass virtual hosting or installed the project in a subdirectory,
### the base path will be prepended to allow proper resolution of
### the index.php file; it will work in non-aliased environments
### as well, providing a safe, one-size fits all solution.
##RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
##RewriteRule ^(.*) - [E=BASE:%1]
##RewriteRule ^(.*)$ %{ENV:BASE}/index.php [L]
##

SetEnv ITB_HOST 167.205.57.98
SetEnv ITB_UNAME postgres
SetEnv ITB_PASS postgres
SetEnv ITB_PORT 5432
SetEnv ITB_SCH sipenkp_itb

#SetEnv ITB_HOST 103.126.28.66
#SetEnv ITB_UNAME postgres
#SetEnv ITB_PASS khansia215758
#SetEnv ITB_PORT 5432
#SetEnv ITB_SCH ftmd_itb


RewriteEngine On


# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

# The following rewrites all other queries to index.php. The
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting or installed the project in a subdirectory,
# the base path will be prepended to allow proper resolution of
# the index.php file; it will work in non-aliased environments
# as well, providing a safe, one-size fits all solution.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]

# Setup a deny/allow
Order Deny,Allow
# Deny from everyone
Deny from all
# except if either of these are satisfied
Satisfy any
# 1. a valid authenticated user
Require valid-user
# or 2. the "require_auth" var is NOT set
Allow from env=!require_auth
# end password protect /api

# disable access to svn files
RewriteRule ^.*(\.svn).*$ - [R=404,L]

# disable directory listing
Options -Indexes


# Secure headers
<ifModule mod_headers.c>
  Header set X-Content-Type-Options nosniff
  # Header set X-Frame-Options deny
  Header unset X-Pingback
</ifModule>


## COMPRESS FILES ##
<IfModule mod_deflate.c>
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml

  # Remove browser bugs (only needed for really old browsers)
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  Header append Vary User-Agent
</IfModule>
## COMPRESS FILES ##

# Setup a deny/allow
#Order Deny,Allow
# Deny from everyone
#Deny from all
# except if either of these are satisfied
#Satisfy any
# 1. a valid authenticated user
#Require valid-user
# or 2. the "require_auth" var is NOT set
#Allow from env=!require_auth
## end password protect /api
