.htaccess Redirect Generator
Build Apache .htaccess rules for the most common redirect
patterns — 301/302, regex rewrites, HTTPS canonical, www toggle, and
full domain moves.
Redirect type
Path on this server, starting with /
Full URL with scheme
Status code
Add to your .htaccess
Frequently asked questions
301 vs 302 — which should I use?
Use a 301 for a permanent move: it passes nearly all SEO ranking signal to the new URL and is cached by browsers. Use a 302 (or 307) only for a temporary redirect you intend to reverse, such as a maintenance page or A/B test.
Where do I put the .htaccess file?
Place it in the root directory of the site or folder you want the rules to apply to (usually the same folder as your homepage). The rules take effect for that folder and everything beneath it.
Why isn't my redirect working?
The most common causes are that mod_rewrite isn't
enabled, the rules are in the wrong order (Apache applies them
top to bottom and the first match can win), or your browser
cached an earlier 301 — test in a private window. Redirects also
only work on Apache servers, not Nginx.
Does this send my URLs anywhere?
No. The rules are generated entirely in your browser from the values you enter; nothing is uploaded.
Related tools
- Meta Tag Generator Generate title, description, OG, and Twitter card tags in one go.
- SERP Previewer Preview how your page will look in Google search results live.
- Open Graph Generator Build Open Graph tags for richer link previews on social media.
- Robots.txt Generator Build a valid robots.txt with allow, disallow, and sitemap rules.