vdesignu.

Tools menu

View all categories

Free tool

Apache .htaccess Redirect Builder

Build Apache .htaccess 301 and 302 redirects as mod_rewrite RewriteRule lines, ready to paste above your CMS rules.

#htaccess #apacheredirect #rewriterule #mod_rewrite

.htaccess Redirects

Crawl Budget Preservation

Old Path
New URL

Your generated code will appear here

Deployment Note

  • Apache: Paste into the `.htaccess` file in your site root, above any CMS rules (such as the WordPress block). Requires `mod_rewrite`. Each rule matches the path with or without a trailing slash; query strings are passed through.

  • Nginx: Place inside your `server ` block and reload Nginx for changes to take effect.

How to use this tool

Follow these steps to get the most out of the Apache .htaccess Redirect Builder.

01

Enter your accurate data in the provided form fields.

02

Review all configuration options and settings.

03

Click the generate or proceed button to execute.

04

Copy, download, or implement the professional output.

In depth

Redirects in .htaccess

The generator writes mod_rewrite RewriteRule lines: each rule matches the old path with or without a trailing slash and sends a 301 (permanent) or 302 (temporary) to the new URL. Place them above your CMS rules, such as the WordPress block, or they may never run.

Test Before You Rely on It

A syntax error in .htaccess returns a 500 error for the whole site, so keep a backup and test on staging first. RewriteRule patterns don't see the query string; it is passed through to the new URL unless you add a RewriteCond.

Want it done for you?

Moving to a new site or platform? We rebuild sites and migrate them without losing the rankings you've earned.

Website Design & Development

More in Redirects & Migrations

Related tools