.htaccess Generator

Create .htaccess rules for redirects, caching, security and more with practical templates.

Configuration

Presets
Redirects
Security
Caching
Compression
Custom Rules

Generated .htaccess

# Redirects
<IfModule mod_rewrite.c>
  RewriteEngine On

  # Force HTTPS
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

# Security

# Disable directory listing
Options -Indexes
This file only works on Apache web servers with mod_rewrite enabled.