Skip to content

Instantly share code, notes, and snippets.

@hailwood
Created February 17, 2015 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hailwood/1f565ee8c754f514f5bf to your computer and use it in GitHub Desktop.
Save hailwood/1f565ee8c754f514f5bf to your computer and use it in GitHub Desktop.
<Files *.ss>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>
<Files web.config>
Order deny,allow
Deny from all
</Files>
<Files *.yml>
Order allow,deny
Deny from all
</Files>
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|svg)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html
SetEnv HTTP_MOD_REWRITE On
RewriteEngine On
RewriteBase '/'
RewriteRule ^vendor(/|$) - [F,L,NC]
RewriteRule silverstripe-cache(/|$) - [F,L,NC]
RewriteRule composer\.(json|lock) - [F,L,NC]
RewriteCond %{HTTP_HOST} ^www.domain.co.nz
RewriteRule (.*) http://domain.co.nz/$1 [R=301,L]
## 301 redirects ##
RewriteRule ^somedir/index.htm$ /location/ [R=301,NE,L]
RewriteRule ^anotherdir$ /another-location/ [R=301,NE,L]
## End 301 ##
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.php$
RewriteRule .* framework/main.php?url=%1&%{QUERY_STRING} [L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment