Theodia/api.theodia.org/master/htdocs/.htaccess - Htaccess File

Theodia/api.theodia.org/master/htdocs/.htaccess

RewriteEngine On

# If available serve pre-gzipped file
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}.gz -s
RewriteRule ^(.*).(html|css|js|data) $1.$2.gz [QSA]

# Prevent double gzip and give the correct mime-type
RewriteRule .css.gz$ - [T=text/css,E=no-gzip:1,E=FORCE_GZIP]
RewriteRule .js.gz$ - [T=application/javascript,E=no-gzip:1,E=FORCE_GZIP]
RewriteRule .html.gz$ - [T=text/html,E=no-gzip:1,E=FORCE_GZIP]
RewriteRule .data.gz$ - [T=text/plain,E=no-gzip:1,E=FORCE_GZIP]

Header set Content-Encoding gzip env=FORCE_GZIP

# 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 rule tells apache to redirect every non reserved URI to index.html that is managed by angular routing
RewriteCond %{REQUEST_URI} !^/api/?.*$
RewriteCond %{REQUEST_URI} !^/apigility/?.*$
RewriteCond %{REQUEST_URI} !^/zf-apigility-documentation-swagger/?.*$
RewriteCond %{REQUEST_URI} !^/ocra_service_manager_yuml/?.*$
RewriteRule ^(.*)$ index.html [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, 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]

On Github License

Files

Download PDF of Htaccess file
ENV, no-gzip, REQUEST_FILENAME, REQUEST_URI

Comments

Apache