57 lines
1.5 KiB
Plaintext
57 lines
1.5 KiB
Plaintext
<?php
|
|
/**
|
|
* File di esempio .htaccess
|
|
* Territory Manager
|
|
*
|
|
* Rinomina questo file in .htaccess per usarlo con Apache
|
|
*/
|
|
|
|
# Abilita RewriteEngine
|
|
# RewriteEngine On
|
|
# RewriteBase /
|
|
|
|
# Redirect da HTTP a HTTPS (decommentare in produzione)
|
|
# RewriteCond %{HTTPS} off
|
|
# RewriteRule ^(.*)$ https://%{HTTP_HOST%{REQUEST_URI} [L,R=301]
|
|
|
|
# Protezione file sensibili
|
|
<FilesMatch "^(config\.php|db\.php|database\.sql)$">
|
|
Order allow,deny
|
|
Deny from all
|
|
</FilesMatch>
|
|
|
|
# Impostazioni PHP
|
|
php_value upload_max_filesize 10M
|
|
php_value post_max_size 10M
|
|
php_value max_execution_time 300
|
|
php_value session.gc_maxlifetime 28800
|
|
|
|
# Protezione directory uploads
|
|
<Directory "uploads">
|
|
Options -Indexes
|
|
php_flag engine off
|
|
</Directory>
|
|
|
|
# Compressione GZIP
|
|
<IfModule mod_deflate.c>
|
|
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
|
|
</IfModule>
|
|
|
|
# Cache statica
|
|
<IfModule mod_expires.c>
|
|
ExpiresActive On
|
|
ExpiresByType image/jpg "access plus 1 year"
|
|
ExpiresByType image/jpeg "access plus 1 year"
|
|
ExpiresByType image/gif "access plus 1 year"
|
|
ExpiresByType image/png "access plus 1 year"
|
|
ExpiresByType text/css "access plus 1 month"
|
|
ExpiresByType application/javascript "access plus 1 month"
|
|
</IfModule>
|
|
|
|
# Sicurezza Headers
|
|
<IfModule mod_headers.c>
|
|
Header set X-Content-Type-Options "nosniff"
|
|
Header set X-Frame-Options "SAMEORIGIN"
|
|
Header set X-XSS-Protection "1; mode=block"
|
|
</IfModule>
|