chucknorris-io/chuck-api/master/www/.htaccess - Htaccess File

chucknorris-io/chuck-api/master/www/.htaccess

# ----------------------------------------------------------------------
# Start rewrite engine
# ----------------------------------------------------------------------

# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
#
# Some cloud hosting services require RewriteBase to be set: goo.gl/HOcPN
# If using the h5bp in a subdirectory, use `RewriteBase /foo` instead where 'foo' is your directory.

##Force SSL 

#Normal way (in case you need to deploy to NON-heroku)
RewriteCond %{HTTPS} !=on

#Heroku way
RewriteCond %{HTTP:X-Forwarded-Proto} !https 

#If neither above conditions are met, redirect to https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine On
  RewriteBase /

  #Rules for Versioned Static Files
  RewriteRule ^(js|css)/(.+).([0-9]+).(js|css)$ /$1/$2.$4 [L]

  # we skip all files with .something
  RewriteCond %{REQUEST_URI} ..+$
  RewriteCond %{REQUEST_URI} !.html$
  RewriteRule .* - [L]

  RewriteRule ^(.*)$ /index.php [QSA,L]

</IfModule>

FallbackResource /index.php

On Github License

Files

Download PDF of Htaccess file
HTTP_HOST, HTTPS, REQUEST_URI, X-Forwarded-Proto

Comments

Apache