無縫 HTTPS 和規範重定向
使用經過驗證的 mod_rewrite 規則,強制實施 HTTPS 流量並在 WWW 和非 WWW 網域規範化之間輕鬆進行選擇。
Htaccess 產生器
即時產生具有 HTTPS 重定向、WWW/非 WWW 規則、瀏覽器快取、IP 封鎖和安全性選項的自訂 Apache .htaccess 設定檔。
Prevents visitors from seeing directory folder contents when no index file exists.
Mitigates clickjacking, MIME sniffing, and XSS vulnerabilities via mod_headers.
Supports Apache 2.4 (Require not ip) with automatic fallback for Apache 2.2.
Instructs browsers to cache static assets locally to reduce server bandwidth.
Compresses text, HTML, CSS, JS, and JSON data before sending it over the wire.
Routes all non-file/non-directory requests to /index.html for React, Vue, or Next export SPAs.
# ================================================================
# Apache .htaccess Configuration File
# Generated by Tool 200 (https://tool200.com/htaccess-generator)
# 100% Client-Side Free .htaccess Generator
# ================================================================
# Disable directory file browsing
Options -Indexes
# Rewrite Engine Settings
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Force HTTPS Redirection
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Redirect www to non-www
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [L,R=301]
</IfModule>
# Custom Error Documents
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html
# Essential Security Headers
<IfModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-Content-Type-Options "nosniff"
Header set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>
# Leverage Browser Caching (Expires Headers)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
# HTML document: don't cache or short cache
ExpiresByType text/html "access plus 0 seconds"
# CSS and JavaScript: 1 month
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
# Images & Favicons: 1 year
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
# Web Fonts: 1 year
ExpiresByType font/ttf "access plus 1 year"
ExpiresByType font/woff "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
</IfModule>
# Gzip / Deflate Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
AddOutputFilterByType DEFLATE application/json application/xml application/rss+xml
AddOutputFilterByType DEFLATE image/svg+xml font/ttf font/otf
</IfModule>優化 Apache Web 伺服器速度、實作安全性 HTTPS 和規範域、利用瀏覽器快取並透過 100% 基於瀏覽器的安全性保護敏感目錄。
使用經過驗證的 mod_rewrite 規則,強制實施 HTTPS 流量並在 WWW 和非 WWW 網域規範化之間輕鬆進行選擇。
啟用 mod_expires 標頭和 mod_deflate gzip 壓縮可大幅加快資產載入速度並增強 Google Core Web Vitals。
停用目錄索引(清單),限制不需要的 IP 位址,並配置自訂錯誤頁面(404、500),實現零伺服器傳輸。
在工作空檔讓大腦放鬆一下的免費網頁經典遊戲合輯。