Files
2026-06-06 10:10:07 +08:00

52 lines
1.4 KiB
ApacheConf

php_value display_errors On
php_value date.timezone Asia/Singapore
# ==============================
# BASIC SETTINGS
# ==============================
# Prevent directory listing
Options -Indexes
# ==============================
# CACHE CONTROL (No caching)
# ==============================
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>
# ==============================
# FORCE HTTPS
# ==============================
<IfModule mod_rewrite.c>
RewriteEngine On
# Redirect HTTP to HTTPS
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# ==============================
# GZIP / COMPRESSION (Optional)
# ==============================
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/json
</IfModule>
# ==============================
# CLEAN URLS (Optional)
# ==============================
<IfModule mod_rewrite.c>
RewriteEngine On
# If request is not a real file, rewrite to .php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+)$ $1.php [L,QSA]
</IfModule>
# ==============================
# CUSTOM 404 PAGE (Optional)
# ==============================
ErrorDocument 404 /404.html