# .htaccess file for STALNA ARBITRAŽA website
# This file handles server configurations for Apache web server
# Enable URL rewriting engine
RewriteEngine On
# Set base directory for rewrites
# RewriteBase /
# Ensure HTTPS
# Uncomment these lines if you want to force HTTPS
# RewriteCond %{HTTPS} off
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Set custom 404 error page
ErrorDocument 404 /404.html
# Check if the requested file exists
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# If file doesn't exist, redirect to 404 page
RewriteRule ^ /404.html [L]
# Prevent directory listing
Options -Indexes
# Set default character set
AddDefaultCharset UTF-8
# Enable gzip compression for better performance
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript application/json
# Set browser caching
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 image/svg+xml "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/html "access plus 1 week"
ExpiresByType application/xhtml+xml "access plus 1 week"
# Prevent access to hidden files and directories
RewriteCond %{SCRIPT_FILENAME} -d [OR]
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule "(^|/)\." - [F]
# Prevent access to backup and source files
Order allow,deny
Deny from all
Satisfy All