Free tool
htaccess Redirect Generator
Generate the htaccess rules for 301 redirects, forcing HTTPS, adding or removing www, and keeping old URLs working after a website migration.
Getting redirects right
Use 301 for anything permanent. It passes the search ranking of the old URL to the new one and tells browsers to stop asking. Use 302 only when the move is genuinely temporary, because a 302 passes nothing and leaves the old URL as the one search engines keep.
Order matters enormously. Rules run top to bottom, and the first match with the L flag stops the rest. Put your specific page redirects above the general HTTPS and www rules, or the general ones will catch the request first and your specific redirect will never fire.
Avoid chains. If old goes to interim and interim goes to new, every visitor makes three requests and some ranking is lost at each hop. When you redirect a second time, update the original rule to point straight at the final destination instead of adding another link to the chain.