Skip to content

.htaccess Generator

Create rules for HTTPS, www, 404 errors, caching, compression and security.

It works in your browser. We do not store or send anything you type.Free · No sign-up required

Workspace · .htaccess Generator

Runs in your browser · 100% local

Solo se usa como referencia; las reglas usan %{HTTP_HOST}.

Estas directivas son para Apache o servidores compatibles. En Nginx se configuran en el bloque del servidor, no en un .htaccess.

Files are processed in your browser; if you are signed in with history enabled, text results appear in your history.
Instructions

How to use it

01

Paste the HTML, headers, URL or any data you want to check.

02

Check the notifications and the result; the verification is carried out in your browser.

03

Copy the report or the generated code so you can use it wherever you need to.

Examples

Examples

HTTPS and without www

Enforce HTTPS and redirect www.tudominio.com to yourdomain.com using Apache rules.

Caching and compression

Add expiry dates for images and compression for HTML, CSS, JavaScript and JSON.

Reference guide

What you need to know

The generator creates a configuration block for Apache with the options you enable. You can combine HTTPS redirection, www normalisation, a custom 404 page, hidden file protection, caching and compression.

The rules must be tested in a staging environment. An incorrect .htaccess file can cause redirect loops or 500 errors. In Nginx, these directives are not applied.

Frequently asked questions

Frequently Asked Questions

No. .htaccess is a feature of Apache and some compatible servers. In Nginx, the configuration is set out in the server file.

Related tools

Other tools that can help with similar tasks.

More at Web diagnostics→
.htaccess Generator for WordPress and Websites · ByTooly