Generate redirect rules for .htaccess, nginx, and other server configurations. Create 301, 302, and 307 redirect rules for URL migrations and site restructuring.
Redirect rules tell browsers and search engines that a URL has moved. A 301 (permanent) redirect transfers link equity to the new URL, making it essential for SEO when pages move. A 302 (temporary) redirect keeps link equity at the original URL. A 307 is the HTTP/1.1 equivalent of 302.
Redirect = Status Code + Old URL Pattern → New URLA redirect consists of: the old URL path (pattern to match), the new URL (destination), and the HTTP status code indicating permanence. 301 passes 90-99% of link equity, 302/307 passes none. Always use 301 for permanent moves to preserve SEO value.
| Input | Output |
|---|---|
| /old-page.html → /new-page.html, Type: 301 | # .htaccess Redirect 301 /old-page.html /new-page.html # nginx rewrite ^/old-page.html$ /new-page.html permanent; |
| /blog/* → /articles/*, Type: 301 | # .htaccess RewriteRule ^blog/(.*)$ /articles/$1 [R=301,L] # nginx rewrite ^/blog/(.*)$ /articles/$1 permanent; |
| /promo → /special-offer, Type: 302 | # .htaccess Redirect 302 /promo /special-offer # nginx rewrite ^/promo$ /special-offer redirect; |