.htaccess Generator
Make safe .htaccess code for HTTPS, www, 301 redirects, security headers and blocking files.
Privacy: this tool runs in your browser. We do not receive what you type or paste. DNS lookups, where used, go from your browser to the public DNS services of Cloudflare and Google. Results are guidance, not a guarantee: always back up before you change anything. See our Terms.
Related guides
- What Is .htaccess? How to Find It, Edit It Safely and Restore It
- Redirect HTTP to HTTPS and www to non-www With .htaccess
- "Too Many Redirects" (ERR_TOO_MANY_REDIRECTS) on WordPress: Fix
- Set Up 301 Redirects in WordPress With a Plugin and Test Them
- Website Security Headers Basics: What They Are and Which Ones to Add
- Stop Brute-Force Login Attacks and xmlrpc.php Abuse on WordPress
- Moving From Wix, Squarespace or GoDaddy Without Losing Google Rankings
- Moving Your Website From HTTP to HTTPS Without Losing Google Rankings
- Redirect One Domain to Another (Domain Forwarding) Without Losing SEO