Htaccess Redirect Generator
Generate 301 and 302 .htaccess redirect rules without coding
The .htaccess file is a server-level configuration file used on Apache-based web servers to control redirects, URL rewrites, access permissions, and more. Writing .htaccess redirect syntax manually is error-prone — a single misplaced character can break your entire website or create infinite redirect loops. The Htaccess Redirect Generator takes the complexity out of the process: enter your old URL and new destination, choose your redirect type, and receive correctly formatted .htaccess code ready to paste into your server.
How It Works
Enter the old URL path you want to redirect and the destination URL you want it to point to. Select either 301 (permanent redirect — the correct choice for SEO) or 302 (temporary redirect). Click Generate to receive the correctly formatted .htaccess rule. Copy the output and paste it into your .htaccess file in the appropriate location on your server.
Key Features
- Supports both 301 permanent and 302 temporary redirect types
- Generates correctly formatted Apache .htaccess syntax
- Simple input fields — no coding or server knowledge required
- Handles both root-level and subdirectory redirects
- Free with instant output
Benefits for Users
- Correctly redirect old URLs to new pages after a site restructure
- Preserve link equity by using 301 redirects instead of deleting old pages
- Implement temporary redirects during site maintenance or campaigns
- Avoid the manual errors that can break .htaccess files
- Ensure search engines and users always land on the correct page
Use Cases
- Redirecting old blog post URLs to new locations after a category restructure
- Setting up 301 redirects as part of a full website migration
- Creating temporary redirects to a maintenance page during site updates
- Implementing redirects for pages moved during a CMS platform switch
- Building redirect maps for client sites during an SEO audit remediation
Related Tools
Related: HTTP Status Code Checker · URL Rewriting Tool · Robots.txt Generator