Home Developer Tools Htaccess Redirect Generator
🔒 Private — data never leaves your browser ⚡ Instant results 🚫 No login required ∞ No limits
Switch tool: ⊞ CSS Grid Generator 🗜️ CSS Minifier & Beautifier 📦 HTML Minifier ↩️ Htaccess Redirect Generator ⏰ Cron Job Expression Generator 🔧 HTTP Request Builder 🔄 Hex to Text Converter 🔢 Number Sorter 🅿️ PascalCase Converter 🐫 camelCase Converter 🍢 kebab-case Converter
💡 Always back up your .htaccess file before making changes. A syntax error in .htaccess causes a 500 Internal Server Error on the entire site.

Rule Type

Redirect Type

Old URL (path only)

New URL

.htaccess output
CSS Grid Generator 🗜️ CSS Minifier & Beautifier 📦 HTML Minifier ↩️ Htaccess Redirect Generator ← current Cron Job Expression Generator 🔧 HTTP Request Builder 🔄 Hex to Text Converter 🔢 Number Sorter 🅿️ PascalCase Converter 🐫 camelCase Converter 🍢 kebab-case Converter
What is a .htaccess file?

A .htaccess file is a configuration file for Apache web servers. It lets you control URL redirects, enforce HTTPS, block IPs, add password protection, set custom error pages, and much more without touching the main server config.

What is the difference between 301 and 302?

A 301 is a permanent redirect. Search engines transfer all ranking signals (link equity) to the new URL. A 302 is temporary — search engines keep the old URL indexed and do not transfer authority. Use 301 for permanent moves, 302 for temporary ones.

Will 301 redirects hurt my SEO?

No. Properly implemented 301 redirects are recommended by Google for site migrations and URL changes. They pass ranking signals to the new URL and prevent duplicate content issues.

How do I force HTTPS?

Use the "Force HTTPS" rule type. It generates a RewriteCond and RewriteRule that permanently redirects all HTTP traffic to HTTPS — the standard approach for SSL enforcement in Apache.

Where do I put the generated code?

Paste it into the .htaccess file in your website's root directory (usually public_html/). Create the file if it doesn't exist. Test all affected URLs immediately after saving.

Does this work for Nginx servers?

No. This tool generates Apache mod_rewrite syntax. Nginx uses a completely different configuration format. If your server runs Nginx, you need Nginx redirect rules instead.