How it works
Using the .htaccess Redirect Builder is designed to be a straightforward process, abstracting away the complex syntax of Apache's mod_rewrite engine.
1. Configure Global Canonical Rules
Start by setting the foundation of your website's routing structure using the Canonical & Server Enforcements panel.
- Force HTTPS: Check this box to automatically redirect all standard HTTP traffic to secure HTTPS.
- WWW Preference: Choose whether your site should force the
www. prefix (e.g., www.example.com), strip it (e.g., example.com), or ignore it entirely. Uniformity here prevents duplicate content penalties from search engines.
- Trailing Slashes: Decide if your URLs should consistently end with a trailing slash (
/) or not.
- Server Tweaks: You can also disable directory indexing (to protect your file structure from public view) or define a custom 404 error page path.
2. Add Custom Path Redirections
For specific page migrations, use the URL Routing & Path Redirection section. Click "Append New Path Mapping" to create a new rule row.
- Match Strategy: * Exact Match: Redirects exactly the specified URL path (best for individual pages).
- Directory Prefix: Redirects a folder and seamlessly passes everything that follows it to the new destination (e.g.,
/old-blog/post-name to /new-blog/post-name).
- Regex: Advanced matching using regular expressions for complex, pattern-based routing.
- Source/Target: Enter your old relative path (e.g.,
/old-page) and your new destination (e.g., /new-page or https://other-domain.com).
- HTTP Code: Select 301 for a permanent redirect or 302 for a temporary one; search engines may use redirect signals when processing moved URLs.
3. Copy Your Generated Code
As you adjust settings and add rules, the tool instantly compiles the underlying code in the Generated Code Output box. The output is structured logically and heavily commented so you know exactly what each block does. Simply click the copy icon, open the .htaccess file in your website's root directory via FTP or your hosting file manager, and paste the code.