private self-hosted shortlink service
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
813 B

# Headers
# Only connect to this site and subdomains via HTTPS for the next two years
Header set Strict-Transport-Security: "max-age=63072000; includeSubDomains"
# Send only the domain as referrer
Header set Referrer-Policy: "strict-origin"
# Prevent browsers from incorrectly detecting non-scripts as scripts
Header set X-Content-Type-Options: "nosniff"
# Block site from being framed with X-Frame-Options
Header set X-Frame-Options: "deny"
# Block pages from loading when they detect reflected XSS attacks
Header set X-XSS-Protection: "1; mode=block"
# Other
# Rewrite rule to get the short URLs
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ redirect.php?short=$1 [L]
# Disable directory indexing
Options -Indexes