Skip to content

Instantly share code, notes, and snippets.

@noogen
Created January 30, 2017 07:37
Show Gist options
  • Save noogen/32dc8afb074a59cb899f49b23ca441c4 to your computer and use it in GitHub Desktop.
Save noogen/32dc8afb074a59cb899f49b23ca441c4 to your computer and use it in GitHub Desktop.
DreamFactory-htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
# this allow for anonymous access
<If "req('X-DreamFactory-Api-Key') == '' && req('X-DreamFactory-Session-Token') == ''">
RequestHeader set X-DreamFactory-Api-Key your-app-token
</If>
RewriteEngine On
# this force https
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Redirect Trailing Slashes...
# RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment