Htaccess Generator

Libreng Online na .htaccess Generator at Apache Configuration Studio

Bumuo ng naka-customize na Apache .htaccess na mga configuration file gamit ang HTTPS redirection, WWW/non-WWW na mga panuntunan, browser caching, IP blocking, at mga opsyon sa seguridad sa real time.

Mabilis na Preset:

1. Pag-redirect at Mga Panuntunan ng Domain

2. Security at Access Control

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. Pagganap, Caching at Compression

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. Mga Custom na Pahina ng Error

Binuo .htaccess Output

.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% na naproseso sa iyong browser. Walang komunikasyon sa server o pag-log.

Bakit Gumamit ng Tool 200 Libreng Online na .htaccess Generator

I-optimize ang bilis ng web server ng Apache, ipatupad ang mga secure na HTTPS at canonical na domain, gamitin ang pag-cache ng browser, at protektahan ang mga sensitibong direktoryo na may 100% na seguridad na nakabatay sa browser.

Walang putol na HTTPS at Canonical Redirect

Ipatupad ang trapiko ng HTTPS at pumili sa pagitan ng WWW at non-WWW na pag-normalize ng domain nang walang kahirap-hirap gamit ang napatunayang mod_rewrite na mga panuntunan.

Gamitin ang Pag-cache at Compression ng Browser

Paganahin ang mod_expires na mga header at mod_deflate gzip compression upang mapabilis ang pag-load ng asset at mapahusay ang Google Core Web Vitals.

Pinatigas na Web Security at IP Defense

Huwag paganahin ang mga index ng direktoryo (listahan), paghigpitan ang mga hindi gustong IP address, at i-configure ang mga custom na pahina ng error (404, 500) na walang paghahatid ng server.

Mabilis na Brain Break

Kumusta ang isang mabilis na mini-game para makapagpahinga?

Kailangan ng 2 minutong pag-refresh ng kaisipan? Tumalon sa isang klasikong larong puzzle sa iyong browser.