Web development

.htaccess Generator

Generate Apache .htaccess snippets for HTTPS redirects, www canonicalization, gzip, caching, directory listing and custom rewrites.

Processed locally in your browser. Your input is not uploaded.

# Generated by Webeface Tools

# Canonical host: blog.webeface.de

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,R=301]

AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
  ExpiresByType image/webp "access plus 6 months"
  ExpiresByType image/svg+xml "access plus 6 months"
</IfModule>

Options -Indexes

AddDefaultCharset UTF-8

How to use this tool

Paste or type your input, adjust the options, then copy or download the result.

Apache .htaccess generator for HTTPS and caching

WordPress on Apache still lives and dies by .htaccess. This generator stacks common recipes: HTTPS, www to apex, gzip, cache headers, UTF-8, directory listing off and SPA fallback.

Read the output before you deploy. A wrong RewriteBase can loop /tools/. Test on staging and keep a backup of the working file.

Nginx users should use the Nginx generator instead. .htaccess is Apache-only.

If you searched for htaccess generator, apache rewrite generator, https redirect htaccess, www redirect, this free online .htaccess Generator is the page you want. HTTPS, www, cache and rewrite rules. It lives at https://blog.webeface.de/tools/htaccess-generator next to the IT – Software Development blog, so you can jump from a Laravel tutorial into a working utility without opening another SaaS.

.htaccess Generator is built for frontend, SEO and server-config work. Generate Apache .htaccess snippets for HTTPS redirects, www canonicalization, gzip, caching, directory listing and custom rewrites. Because processing is local, you can paste staging tokens, draft SQL or unpublished copy without sending it to an unknown formatter.

People also look this tool up as htaccess generator, apache rewrite generator, https redirect htaccess, www redirect. Those queries all describe the same job: https, www, cache and rewrite rules. Bookmark the English URL; German lives under /de.

On a German keyboard you may have typed .htaccess Generator, HTTPS Weiterleitung, Apache Rewrite. The .htaccess Generator still solves that request. Webeface targets DACH developers who read English tool names but search in German.

A typical workflow is: open .htaccess Generator, paste the sample, copy the result, then continue in robots.txt Generator, HTTP Headers Viewer, Laravel Route Helper. Keeping the utilities on one origin (blog.webeface.de/tools) means one privacy policy and one brand you already know from the blog.

There is no paywall, watermark or daily quota on the .htaccess Generator. If a search result promised “htaccess generator online free”, this page is that result: fast, private and meant to be used every day.

Step-by-step

  1. Open the free .htaccess Generator at https://blog.webeface.de/tools/htaccess-generator.
  2. Paste or type your input. Nothing is stored as a document on our servers for this editor.
  3. Adjust options (format, dialect, flags, stack) until the preview matches what you need.
  4. Copy or download the result into Laravel, Nuxt, Nginx, Docker or your editor.
  5. Follow related tools (robots.txt Generator, HTTP Headers Viewer, Laravel Route Helper) if the next step is a conversion or check.

When to use this tool

  • Force HTTPS on a newly installed certificate.
  • Cache CSS and JS for a month.
  • Add an SPA fallback for the Nuxt tools build.
  • Search Google for “htaccess generator” when you are away from your editor.
  • Share .htaccess Generator with a teammate instead of pasting secrets into a random website.

Search terms for this page

People find .htaccess Generator with these queries:

  • htaccess generator
  • apache rewrite generator
  • https redirect htaccess
  • www redirect

Frequently asked questions

Will this break WordPress permalinks?

WordPress writes its own rewrite block. Merge carefully and do not remove the WordPress section.

Can I use this on Nginx?

No. Generate an Nginx server block instead.

Is the .htaccess Generator free to use?

Yes. The .htaccess Generator on Webeface Tools is free, has no signup and no usage limit.

Do I need an account to use the .htaccess Generator?

No account is required. Open the page and start immediately.

Is my data uploaded when I use the .htaccess Generator?

No. The .htaccess Generator runs in your browser. Input stays on this device.

How do I find this .htaccess Generator again?

Bookmark https://blog.webeface.de/tools/htaccess-generator or search for htaccess generator on Google together with “webeface”.

Does the .htaccess Generator work on mobile?

Yes. The layout works on phones and desktops. Large pastes are easier on a computer.

Related tools