Skip to content

Instantly share code, notes, and snippets.

@curipha
Created June 5, 2022 00:52
Show Gist options
  • Save curipha/7e6b55c01f334dca90ae232dcfe97b67 to your computer and use it in GitHub Desktop.
Save curipha/7e6b55c01f334dca90ae232dcfe97b67 to your computer and use it in GitHub Desktop.
# _ _ 2020.-1.26
# | |_| |_ __ _ __ __ ___ ______
# _| ' \ _/ _` / _/ _/ -_|_-<_-<
# (_)_||_\__\__,_\__\__\___/__/__/
# Apache preferences
# ------------------
AddDefaultCharset UTF-8
DirectoryIndex index.html .forbidden
MultiviewsMatch Any
# Module
# ------------------
<IfModule mod_headers.c>
Header always set X-Content-Type-Options "nosniff"
Header always set X-UA-Compatible "IE=edge"
Header always set X-XSS-Protection "1; mode=block"
Header always set X-Frame-Options "SAMEORIGIN"
Header always append X-Robots-Tag "noarchive"
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/gif "access plus 30 minutes"
ExpiresByType image/jpeg "access plus 30 minutes"
ExpiresByType image/png "access plus 30 minutes"
</IfModule>
# Access control
# ------------------
<FilesMatch "^\.">
order deny,allow
deny from all
</FilesMatch>
<FilesMatch "\.(tmp|bak)$">
order deny,allow
deny from all
</FilesMatch>
<Files php.ini>
order deny,allow
deny from all
</Files>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment