Free Htaccess Redirect Generator
The Htaccess Redirect Generator creates Apache.htaccess rules for common redirects — 301/302 URL redirects, forcing HTTPS, and www vs non-www. Pick a type, enter the paths, and copy the rules.
The redirect destination should be verified with the HTTP Header Checker, and a bulk set of rules is easier to author with the Redirect Map Generator. The Broken Link Checker List tool helps find the URLs that need rules.
How to use the Htaccess Redirects
- 1 Enter the old path and the new path for each redirect you need.
- 2 Choose the redirect type — permanent for a moved resource, temporary for anything else.
- 3 Add the rule modifiers you need, such as preserving query strings.
- 4 Copy the generated rules into your server configuration file.
Why server-level redirects matter
A redirect is a signal about permanence, and search engines use it to decide how to treat the destination. A permanent redirect transfers the accumulated signals from the old URL to the new one; a temporary one does not, because it implies the change may be reversed. Using the right one is how a site migration preserves its standing rather than starting from nothing.
The practical case is domain consolidation. Moving from a www host to a bare one, or migrating to a new domain, requires that every old URL redirects to its exact new counterpart rather than to the homepage. A redirect to the homepage for an old article is treated as a soft 404 and loses the value entirely, which is the most common migration mistake there is.
Rules that avoid trouble
- Map each old URL to its specific new equivalent; never bulk-redirect everything to the root.
- Test the whole chain after deploying, since a rule that redirects to another redirected URL compounds latency.
- Remove rules once the transition period has passed, so the file does not accumulate.
- Check for loops before deploying — a rule that catches its own destination will fail the request entirely.
Frequently asked questions
When should a redirect be permanent and when temporary?
Permanent when the resource has genuinely moved and the old location will never return, because clients are entitled to remember that answer and stop asking. Temporary when the change might be reversed or when the redirect is part of a deliberate test, so clients keep requesting the original. Choosing permanent by mistake is difficult to undo, since browsers that cached the rule will not ask again.
Why must I use the server configuration file?
Because redirects work at the server level, before any content is served. A client-side redirect runs after the page has loaded, which costs the visitor a round trip and gives search engines a worse signal. The server configuration file is also read before your application code runs, so it can handle a URL that no longer has any code to serve.
What happens to my existing rules?
Nothing, unless you overwrite them. The file is processed from top to bottom and the first matching rule wins, so order matters and a broad rule placed above a specific one will shadow it. Adding rules at the end is safer than inserting them, and checking the whole file rather than only the new part is worth the minute it takes.
Related SEO & Webmaster Tools
You might also need
Tools from other categories that people pair with the Htaccess Redirects: