301 and 302 Redirect Generator (.htaccess)
Create 301 (permanent) and 302 (temporary) redirects for Apache. Get ready-made Redirect or RewriteRule lines, copy them and paste into .htaccess.
301 and 302 redirect generator
Generate ready-made .htaccess (Apache) rules with 301 (permanent) or 302 (temporary).
/blog/post. You can paste the full URL and the tool cleans it up.
https://www.yoursite.com/new-page
Result (.htaccess):
How to use
- Fill in the old URL and the new URL.
- Choose 301 (permanent) or 302 (temporary).
- Click Generate rule and copy it.
- Paste it into your .htaccess file (usually in the site root).
Tip: after redirecting URLs, update your sitemap with the XML sitemap generator. For HTTPS, www and security rules, use the .htaccess generator.
Frequently asked questions
What is the difference between a 301 and a 302 redirect?
A 301 redirect is permanent: it tells Google the URL has moved for good and passes the ranking signals to the new page. A 302 is temporary: it says the original URL may be used again later.
When should I use a 301 redirect?
When the change is permanent, such as a domain migration, a new URL structure or a page that will not come back.
When should I use a 302 redirect?
Only when the change is temporary, such as a page under maintenance, a seasonal promotion or an A/B test. For permanent changes, use 301.
Does a 301 redirect hurt SEO?
No. When set up correctly, a 301 keeps the authority of the old page and helps Google index the new URL.
Where do I put the redirect rule?
On Apache servers, rules usually go in the .htaccess file at the root of the site (public_html or the main folder of the domain).
Should I use Redirect or RewriteRule?
Redirect is simpler and fine for basic cases. RewriteRule is more flexible and better when you need to handle trailing slashes, regular expressions or the query string.
What is a redirect loop?
A loop happens when a URL redirects to another one that ends up redirecting back to the first. Browsers show errors like ERR_TOO_MANY_REDIRECTS.
Do I need to update the sitemap after creating redirects?
Yes. After changing URLs, generate a new XML sitemap that lists only the final URLs.
Does this generator work for WordPress?
Yes. The rules work on WordPress sites running on Apache with an .htaccess file. Put them above the WordPress block.
Is the tool free?
Yes. The Makrosites 301 and 302 redirect generator is completely free and you can use it as often as you like.
Need a full technical SEO review of your site?
We find what holds your site back on Google (broken links, redirects, slow pages, indexing problems) and fix it.