Redirect Rule Generator
Generate Apache and Nginx redirect rules.
Loading workspace...
About the Redirect Rule Generator
Use it to write correct 301 and 302 redirect rules for Apache (.htaccess) and Nginx without memorising the syntax.
Runs entirely in your browser. Your files and text are never uploaded.
How to use it
- Enter the old path and the new destination.
- Choose permanent (301) or temporary (302), and your server type.
- Copy the rules into .htaccess or your Nginx config and test them.
Frequently asked questions
Where do I put .htaccess redirects?
In the .htaccess file in your site's root folder on Apache or LiteSpeed hosting. Back the file up first.
Should I use 301 or 308?
Both are permanent. 301 is universally understood. 308 also keeps the request method, which matters for forms and APIs.
How do I test a redirect?
Use the Redirect Checker to confirm the status code and final destination, and to make sure you did not create a loop.
Related Tools
Specialized workflows in Website & Performance