Create htaccess files for Apache servers with redirect, auth, and caching rules.
The .htaccess Generator builds an Apache .htaccess file from a form: force HTTPS, always use or drop www (in a single redirect, not a chain), a custom 404 page, GZIP compression, browser caching, hidden folder listings, basic security headers, permanent 301 redirects and IP blocking. Addresses you type are validated so the file cannot contain broken directives, and you can copy or download it. It runs in your browser.
Made for everyone. Typical uses:
It is for Apache servers (including most shared hosting) and does not work on Nginx or on hosts that ignore .htaccess. The IP block needs Apache 2.4 or newer. Modules are wrapped so a missing module does not cause an error, but always keep a backup of your current .htaccess and test on a staging site, because a mistake can cause a 500 error.
Accuracy: Output is produced in your browser and is meant for convenience. Check it before you use it for anything important.
A step-by-step way to find out why a site is down or misbehaving: check DNS records, then the HTTP status code and redirect chain, then domain expiry and your own IP.
Explore more in Generators, read the guides and articles, or see how we test our tools.
Generate a robots.txt file for your website.
Best for keeping crawlers out of admin, cart, checkout and internal search pages
Generate XML sitemaps for better search engine indexing.
Best for creating a sitemap for a small or new site
Generate Docker Compose files for multi-container applications.
Best for scaffolding a docker-compose.yml for an app plus a database container without memorizing YAML syntax
Generate SEO-optimized meta tags for your web pages.
Best for creating SEO meta tags for new web pages