Paste old and new URL pairs and generate clean .htaccess redirect rules in seconds, with 301 or 302 status and Redirect or mod_rewrite output. Free, no signup.
Old and new URLs
Redirect directive is the simplest choice for .htaccess. Use mod_rewrite when you need regular expressions, or when your server already uses RewriteRule.
Paste one old and new URL pair per line, then click Generate .htaccess rules.
Free, no signup. The rules are generated in your browser and nothing is uploaded or stored.
.htaccess rules
Your generated rules will appear here.
Rules are generated in your browser. Nothing is uploaded or stored.
What is an htaccess redirect generator?
An htaccess redirect generator builds the redirect rules you paste into your .htaccess file. Paste an old URL and its new destination, choose 301 or 302, and copy the rules ready to use.
Redirects keep visitors and search engines moving when a page moves or a URL changes. Use a 301 for a permanent move, so ranking signals follow the new page, and a 302 only while a move is temporary.
How to generate .htaccess redirect rules with this free tool
Paste one old and new URL pair per line, with the old URL first, then a space, comma or arrow, then the new URL.
Choose 301 permanent or 302 temporary, and choose Redirect directive or mod_rewrite output.
Click Generate .htaccess rules and check each line. Any line the tool cannot read is flagged with its line number.
Copy the rules, or download them as a .htaccess file, and paste them into the .htaccess file in your site root.
Test each redirect in a browser and update any internal links that still point to the old URLs.
Answers to the questions we hear most about .htaccess redirects.
A 301 is a permanent redirect, so search engines pass ranking signals to the new URL and update their index. A 302 is temporary, so search engines keep the old URL in their index while they check the new page. Use a 301 for a permanent move and a 302 only while a move is temporary.
Use a Redirect directive for a simple old-to-new URL move, because it is shorter and easier to read. Use a RewriteRule when you need regular expressions, a condition, or when your server already rewrites URLs with mod_rewrite. This tool generates both, so choose the format that matches the rest of your .htaccess file.
Put the rules near the top of the .htaccess file in your website root, before other rewrite rules if your site uses them. Test one redirect in a browser before you add the rest, and keep a backup copy of the file before you change it.
The tool flags the line number and explains what is wrong, instead of silently skipping it. That helps you find the problem line quickly, fix it, and generate the rules again. Each line needs one old URL and one new URL, separated by a space, a comma or an arrow.
No. The rules are generated in your browser and nothing is sent to a server, uploaded or stored. You can close the page after you copy the rules.
Open the old URL in a browser and check it goes to the new page, and check the status code is 301 or 302 as you intended. Also update your internal links and your sitemap so they point to the new URLs, not the old ones.
We scale your organic traffic with editorial content & natural link building.
Tell us your site and your competitors — we come back with a free link plan, a site list and a custom quote.