forked from Afinity-Labs/LinkTree-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.htaccess
More file actions
39 lines (29 loc) · 1.48 KB
/
.htaccess
File metadata and controls
39 lines (29 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
RewriteEngine On
# Force HTTPS for all incoming requests
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Custom error pages
ErrorDocument 404 /index.html
# Prevent directory listings
Options -Indexes
# Add essential security headers
<IfModule mod_headers.c>
# Enable Strict-Transport-Security (HSTS) to enforce HTTPS
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
# X-Frame-Options to prevent clickjacking
Header always set X-Frame-Options "DENY"
# X-Content-Type-Options to prevent MIME-type sniffing
Header set X-Content-Type-Options "nosniff"
# Referrer-Policy to limit information leakage
Header set Referrer-Policy "no-referrer-when-downgrade"
# Permissions-Policy to limit browser feature use
Header set Permissions-Policy "geolocation=(), microphone=(), camera=()"
# Content-Security-Policy (CSP) - updated to allow external Font Awesome styles and fonts
Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com; img-src 'self'; font-src 'self' https://cdnjs.cloudflare.com data:;"
</IfModule>
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php80” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php80 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit