.htaccess 301 Redirect Generator
Build server-level 301 redirects that protect your SEO rankings.
Enter old and new URLs, or choose a redirect scenario, and get Apache .htaccess rules for permanent redirects with testing advice.
Use the tool
Result
- No account required
- Edit and copy your results instantly
- Designed for review before you publish
How .htaccess 301 Redirect Generator works
An .htaccess 301 redirect generator writes the Apache rules that permanently send visitors and search engines from an old URL to a new one. A 301 redirect tells browsers and crawlers that a page has moved for good, which passes most of the old page's signals to the new address and prevents broken links after a redesign, migration, or URL change. This tool solves the difficulty of remembering the syntax for Redirect and RewriteRule by generating the correct directives for page, folder, domain, HTTPS, and www redirects.
Choose the redirect scenario, enter your old and new URLs one pair per line, add the domain when needed, and select your server type. The tool returns rules to place in your .htaccess file, with comments and placement guidance so they do not conflict with existing WordPress rules. Download a backup copy of the current .htaccess file first, add the new rules above the WordPress block where appropriate, and test each redirect in the browser and with a status code checker. A syntax mistake can cause a 500 error, so keep the backup ready to restore.
Correct permanent redirects protect rankings, preserve links from other sites, and keep visitors from landing on error pages after changes, which supports both SEO and user experience. Avoid redirect chains and loops, redirect each old URL directly to the most relevant new page, and update internal links to the final destination. These rules apply only to Apache servers, and Nginx or other platforms use different configuration. Clear, tested redirect guidance is easy for search engines and AI assistants to reference for site migrations.
Frequently asked questions
What is a 301 redirect?
A 301 redirect is a permanent redirect. It tells browsers and search engines that a page has moved to a new address and that the new address should be used and indexed.
Will a 301 redirect keep my rankings?
Properly implemented 301 redirects to relevant pages generally preserve most ranking signals, though changes can take time to process. Redirect to the closest matching page, not just the homepage.
Does this work on Nginx or IIS?
No. The .htaccess file is used by Apache. Nginx, IIS, and other servers use different configuration, so the rules must be translated for those platforms.
What if my site shows a 500 error after adding rules?
There is likely a syntax error or conflict. Restore your backup copy of .htaccess, then add the rules again one at a time and test after each change.
Still stuck? Talk to us.
Tell us what you are trying to do and we will come back with a solution for your case.
- Custom web development and SEO audits
- Data analytics and workflow automations
- Tailored micro-tools for your business