Skip to content

Instantly share code, notes, and snippets.

@bu-s
Created April 21, 2014 14:01
Show Gist options
  • Save bu-s/11143601 to your computer and use it in GitHub Desktop.
Save bu-s/11143601 to your computer and use it in GitHub Desktop.
Basic .htaccess LAMP stack
# Etags
# NOTE: You can add/or remove additional file types to suite you requirements.
<FilesMatch "\.(ico|icon|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$">
Header set Expires "Thu, 15 Apr 2016 20:00:00 GMT"
Header unset ETag
FileETag None
</FilesMatch>
# Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>
#End Gzip
# Custom 404 page
# NOTE: I often use this with static sites so I usually define my custom error pages myself here. Add custom pages to handle 500 or 403 in this manner too.
ErrorDocument 404 /404.html
@bu-s
Copy link
Author

bu-s commented Apr 21, 2014

This is a basic ".htaccess" file configuration that I use on small static websites.

I am a Web Designer and Illustrator with a focus on UX, IA and the visual design side of Web Design. I appreciate that this may not be the best or most economical configuration. If you have any comments or advice to improve it I would be grateful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment