About the 301 Redirect Generator
The 301 Redirect Generator produces the code for a permanent redirect from an old URL to a new one, in the format your platform needs: Apache .htaccess, an Nginx location block, a PHP header() call, an Express.js route, a Netlify _redirects line or a vercel.json rule.
How to use the 301 Redirect Generator
- Enter the old URL or path and the new URL.
- Choose your hosting platform or server.
- Copy the code into the right file and test the old address.
Example
Nginx
location = /old-page {
return 301 https://example.com/new-page;
}
Frequently asked questions
Should I use a full URL or a path for the old address?
Apache, Nginx, Netlify and Vercel rules match the path (for example /old-page), so enter the path. The new URL can be a full URL.
How long should I keep redirects?
At least a year, and ideally permanently for URLs that had links or traffic.
Do redirects pass SEO value?
Search engines treat permanent redirects as a strong signal to move ranking signals to the new URL.