Skip to content
ZeroServer.tools

htaccess Redirect Generator

Build Apache .htaccess 301 and 302 redirect rules.

Redirect type
.htaccess
# Redirect rules — place in your site's .htaccess (mod_alias)
Redirect 301 /old-page /new-page
Redirect 301 /blog/old-post https://example.com/blog/new-post

How .htaccess redirects work

On Apache servers, a .htaccess file can redirect old URLs to new ones using the Redirect directive (mod_alias). A 301 is a permanent move and passes SEO ranking to the new URL; a 302 is temporary. The from is a path on your site (starting with /); the to can be a path or a full URL. Rules are generated in your browser — paste them at the top of your .htaccess.

Related: the canonical tag generator, the robots.txt generator, and the htpasswd generator.

Related Web & SEO tools