Build your own .htaccess, without the typos
Check the boxes, fill in the values, and a fully commented .htaccess appears live on the right, ready to copy or download. Runs entirely in your browser, nothing gets uploaded.
Read this before you deploy
Back up your existing .htaccess before replacing it – a mistake in this file can take down the whole site (server error 500). Changes can always be undone via FTP by restoring the old file.
Redirects every request from http to https.
WWW variant
301 redirects
Permanently redirect old paths to new target URLs.
No redirect added yet.
Spaces: the old path gets quoted, the target URL is encoded as %20.
Browser caching
Serve text-based files compressed.
Security headers
Caution: browsers remember HSTS for a long time. Only enable it once HTTPS reliably works across the whole site.
Prevents folder contents from being listed in the browser when there is no index file.
Blocks access to hidden files like .env or .git, except .well-known.
Your .htaccess
Manage 301 redirects more comfortably
Maintaining redirects by hand in .htaccess gets messy fast. It is easier inside WordPress, with click stats and a 404 monitor: Linkjet.
See LinkjetManage redirects more comfortably with Linkjet
Free, GPLv2, self-hosted: Linkjet manages redirects right inside WordPress, with click stats, QR codes and a 404 monitor instead of manual .htaccess editing.