Adding redirect rules to .htaccess
On Apache servers, the .htaccess file's Redirect directive sends visitors - and
search engines - from an old URL straight to a new one. Add each old-path/new-path pair below, choose 301
(permanent) or 302 (temporary), and paste the generated lines directly into your site's
.htaccess file, placed above any existing RewriteRule block.
301 vs. 302: why the choice actually matters
A 301 tells browsers and search engines the move is permanent, which causes search engines to transfer the old page's accumulated ranking signals and link equity over to the new URL - this is the right choice for a page that has genuinely moved for good, such as during a site restructure or URL-slug change. A 302 signals a temporary move instead; search engines generally keep the old URL indexed rather than transferring its signals, which is correct behavior for something like a short-term maintenance redirect, but the wrong choice if the move is actually permanent.
Why placement in the file matters
Apache processes directives from different modules - mod_alias (which provides the simple
Redirect directive this tool generates) and mod_rewrite (which provides
RewriteRule) - and these can conflict or produce unexpected results if ordered incorrectly.
Placing simple Redirect directives near the top of the file, before any RewriteEngine/RewriteRule block,
avoids that class of problem.
Common reasons to set up a redirect
A page or post has been renamed or moved to a new URL slug, an entire site has migrated to a new domain or URL structure, or an old URL has started returning a 404 that still receives real search traffic or backlinks you don't want to lose - in every one of these cases, a 301 redirect preserves that traffic and ranking value instead of letting it go to a dead end.
Redirect rules without guesswork
On Apache servers the .htaccess file controls redirects, and a single typing mistake can take a site offline. This tool writes the rules for you for common cases such as 301 redirects, forcing HTTPS and choosing www or non-www.
Use it safely
Copy your existing .htaccess before changing it, add rules one at a time and test several URLs after each change. Keep the rules in a sensible order, as the first matching rule usually wins.
Know your server
These rules work on Apache and compatible servers. Nginx uses a different configuration format, and some hosts manage redirects in their control panel, so check how your hosting works first.
Common rules
A permanent redirect from an old page can be written Redirect 301 /old-page https://example.com/new-page. To force HTTPS use RewriteEngine On, RewriteCond %{HTTPS} off and a RewriteRule that sends visitors to the secure version. Always use 301 for permanent moves so link value passes.
Safe editing
Back up .htaccess, test one change at a time, avoid redirect loops and check the result with a redirect checker. A syntax error can take the site down, so keep FTP or file manager access ready.