SEO & Webmaster Tools
100% Client-Side 100% Client-Side. Generated .htaccess stays on your device.

Apache .htaccess Configuration Generator

Generate production-grade .htaccess rules for HTTPS, Gzip, browser cache, and security

⚙️

Webmaster & Server Configuration Studio

100% Client-Side Apache .htaccess, 301/302 Redirection, PWA Manifest & Favicon Package Generator

Apache .htaccess Directives

Canonical Domain (WWW)
Custom 404 Error Page Path
.htaccessApache 2.4+ Ready
# ===============================================
# NEOKYRU Production-Hardened .htaccess Config
# ===============================================

# Disable Directory Browsing
Options -Indexes

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /

  # Force HTTPS
  RewriteCond %{HTTPS} !=on
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

# Gzip / Deflate Compression
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
  AddOutputFilterByType DEFLATE application/javascript application/json application/xml application/xhtml+xml
  AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>

# Browser Caching via mod_expires
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 month"
  ExpiresByType image/jpg "access plus 1 year"
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/png "access plus 1 year"
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/svg+xml "access plus 1 year"
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
  ExpiresByType font/woff2 "access plus 1 year"
</IfModule>

# Security Headers
<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  Header set X-Frame-Options "SAMEORIGIN"
  Header set X-XSS-Protection "1; mode=block"
  Header set Referrer-Policy "strict-origin-when-cross-origin"
  Header set Permissions-Policy "camera=(), microphone=(), geolocation=()"
</IfModule>

ErrorDocument 404 /404.html

Place this file in the root directory (public_html/ or www/) of your Apache web server.

About Apache .htaccess Configuration Generator

Generate optimized Apache .htaccess configurations. Configure automatic HTTPS redirection, canonical www or non-www enforcement, Gzip/Deflate compression, browser caching headers (mod_expires), security headers, and custom 404 pages.

Key Capabilities & Features

  • Force HTTPS redirection with 301 status code
  • Canonical domain enforcement (force www or non-www)
  • Gzip / Deflate compression rules for text, HTML, CSS, JS, and JSON
  • Browser caching headers (mod_expires) up to 1 year for static assets
  • Security headers: X-Frame-Options, X-Content-Type-Options, Referrer-Policy
  • Custom 404 error page path configuration

How to Use Apache .htaccess Configuration Generator

1

Select Directives

Toggle desired features like HTTPS, Gzip, caching, and security headers.

2

Review Configuration

Inspect the generated .htaccess code with syntax highlighting.

3

Deploy File

Download or copy the file into the root folder (public_html/) of your Apache server.

Privacy & In-Browser Execution Guarantee

100% Client-Side. Generated .htaccess stays on your device.

Frequently Asked Questions

Where do I upload the generated .htaccess file?

Upload the .htaccess file to your website root directory (usually public_html/ or www/) on your Apache web server.