.htaccess Generator
Generate Apache .htaccess rules — HTTPS redirect, www/non-www, caching, compression, and security headers.
Redirects
Performance
Security
PHP / SPA
About .htaccess
.htaccess (hypertext access) is an Apache web server configuration file placed in a directory to control access and behaviour for that directory and its subdirectories. It is processed on every request, making it slower than server-level configuration — but it is the only option on shared hosting environments where you cannot edit httpd.conf. Common uses: HTTPS redirects, URL rewrites, access control, caching headers, security headers, and custom error pages.
FAQ
Does .htaccess work on Nginx?
No. .htaccess is an Apache-specific file. Nginx does not read .htaccess files. On Nginx servers, equivalent rules go in the server{} block of the Nginx configuration file (typically /etc/nginx/sites-available/yourdomain.conf). Most modern VPS and cloud hosting uses Nginx. Use .htaccess only on Apache servers (common in shared hosting like cPanel environments).