âš™ī¸ .htaccess Generator

đŸĻ Twitter 📘 Facebook 🔗 Copy Link

Create Apache .htaccess files visually — no coding required

🌐 Domain Settings

Force HTTPS
Redirect all HTTP traffic to HTTPS
Force www
Redirect non-www to www (e.g., example.com → www.example.com)
Force non-www
Redirect www to non-www (e.g., www.example.com → example.com)

🔄 301 Redirects

→

⚡ Performance

Enable Gzip Compression
Compress text, CSS, JS, JSON, XML, SVG
Browser Caching
Set Expires headers for images, CSS, JS (1 year)
Keep-Alive Headers
Enable persistent connections

🔒 Security

Hotlink Protection
Prevent other sites from linking your images
Block Bad Bots
Block common spam bots by user-agent
Disable Directory Listing
Prevent browsing directory contents

📄 Custom Headers

Security Headers
X-Content-Type-Options, X-Frame-Options, X-XSS-Protection
CORS Headers
Allow cross-origin requests from any domain

📋 Generated .htaccess

â„šī¸ How It Works

1

Configure

Toggle the features you need and add redirect rules

2

Generate

Code is generated instantly as you make changes

3

Copy & Deploy

Copy the code and paste into your .htaccess file

❓ FAQ

What is .htaccess?

.htaccess is a configuration file used by Apache web servers to control directory-level settings like redirects, authentication, and caching.

How do I force HTTPS?

Enable "Force HTTPS" above. It generates a RewriteRule that redirects all HTTP requests to HTTPS with a 301 status code.

What is a 301 redirect?

A 301 redirect is a permanent redirect that tells search engines the page has moved permanently, transferring most SEO value to the new URL.

How do I enable Gzip compression?

Enable "Enable Gzip Compression" above. It uses mod_deflate to compress text-based files, reducing transfer sizes by 60-80%.

What is hotlink protection?

Hotlink protection prevents other websites from directly linking to your images and files, saving your bandwidth and server resources.

How do I redirect www to non-www?

Enable "Force non-www" above. It uses a RewriteCond to detect www and redirects to the non-www version.

What are security headers?

Security headers like X-Content-Type-Options, X-Frame-Options, and X-XSS-Protection protect against common web vulnerabilities like clickjacking and MIME sniffing.

Where do I put the .htaccess file?

Place .htaccess in your website root directory (typically public_html or the document root). It affects that directory and all subdirectories.

Copied to clipboard!

đŸ› ī¸ Related Tools You Might Like

Robots.txt Generator
Free online tool →
Sitemap XML Generator
Free online tool →
SSL Certificate Checker
Free online tool →
SEO Audit Tool
Free online tool →
Meta Tag Generator
Free online tool →