Generátor Htaccess

Zdarma online generátor .htaccess a konfigurační studio Apache

Vytvářejte přizpůsobené konfigurační soubory Apache .htaccess s přesměrováním HTTPS, pravidly WWW/non-WWW, ukládáním do mezipaměti prohlížeče, blokováním IP a možnostmi zabezpečení v reálném čase.

Rychlé předvolby:

1. Pravidla přesměrování a domény

2. Zabezpečení a kontrola přístupu

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.

4. Výkon, ukládání do mezipaměti a komprese

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.

3. Vlastní chybové stránky

Generovaný výstup .htaccess

.htaccess
# ================================================================
# 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>
100% zpracováno ve vašem prohlížeči. Žádná komunikace se serverem ani protokolování.

Proč používat Tool 200 Free Online .htaccess Generator

Optimalizujte rychlost webového serveru Apache, vynucujte zabezpečené HTTPS a kanonické domény, využijte mezipaměť prohlížeče a chraňte citlivé adresáře pomocí 100% zabezpečení založeného na prohlížeči.

Bezproblémová HTTPS a kanonická přesměrování

Vynuťte provoz HTTPS a vyberte si mezi normalizací WWW a jiné domény bez námahy pomocí osvědčených pravidel mod_rewrite.

Využijte ukládání do mezipaměti a komprese prohlížeče

Povolte záhlaví mod_expires a kompresi gzip mod_deflate, abyste výrazně urychlili načítání prostředků a vylepšili Google Core Web Vitals.

Posílená webová bezpečnost a IP obrana

Zakažte indexy adresářů (výpis), omezte nežádoucí adresy IP a nakonfigurujte vlastní chybové stránky (404, 500) s nulovým přenosem serveru.

Rychlý Brain Break

Co takhle rychlá minihra na pročištění hlavy?

Potřebujete 2minutové duševní osvěžení? Skočte do klasické logické hry přímo ve vašem prohlížeči.