Always back up your existing .htaccess before editing. These rules apply to Apache servers only and a single typo can take a site offline.
Built by Rankite, the SEO team behind Swordfish AI's +400% revenue and Zluri's +45% organic growth. See the case studies
A redirect tells browsers and search engines that a URL has moved and points them to its new home. On Apache servers you set this up in the .htaccess file using either a permanent 301 or a temporary 302. The generator above writes those rules for you from a simple list of old and new URLs, with optional blocks to force HTTPS and standardize www. Below is what each option does and how to avoid the mistakes that quietly cost rankings.
The difference comes down to permanence. A 301 is a permanent redirect: it tells search engines the old URL is gone for good, so they should drop it from the index and pass its accumulated link equity to the new URL. This is what you want for almost every real move, such as a renamed page, a restructured URL or a domain migration. A 302 is a temporary redirect. It signals that the move is short-lived, so engines keep the original URL indexed and do not transfer authority to the destination.
Reach for a 302 only when the change really is temporary: an A/B test, a country-specific landing page, a seasonal promotion that will revert, or maintenance routing. Using a 302 for a permanent move is a common and costly error, because the new page never inherits the old page's rankings. When in doubt for a move you expect to keep, choose 301.
The .htaccess file lives in the root directory of your site, usually the public_html or www folder on your Apache host. It is a hidden file, so you may need to enable hidden files in your FTP client or hosting file manager before you can see it. If one does not exist, you can create a plain text file named exactly .htaccess with no extension.
Back up the current file first by downloading a copy you can restore. Then paste the generated rules, ideally near the top, and save. Test a couple of the old URLs in a private browser window to confirm they land on the right destinations. These directives only work on Apache: if your site runs on Nginx, IIS or Caddy, the syntax will not apply and you will need that server's own redirect configuration instead.
A few patterns turn a helpful redirect into a ranking problem. Redirect chains, where URL A points to B which points to C, waste crawl budget and slowly leak link equity at every hop, so always send the old URL straight to its final destination. Redirect loops, where two rules point at each other, make a page unreachable and throw a browser error. Redirecting every old URL to the homepage is another quiet killer: it looks tidy but is treated as a soft 404, so the old page's rankings evaporate instead of transferring. Map each old URL to the closest matching new page so authority flows where it belongs. Finally, double-check you are using 301 rather than 302 for permanent moves, since the wrong status code is one of the easiest ways to lose hard-won rankings without noticing.
Want this done for you? Rankite offers technical SEO audit and monthly SEO management.
Build a clean robots.txt that tells crawlers exactly what to index and what to skip.
Turn any title into a clean, SEO-friendly URL slug with one click.
Create valid FAQ schema markup that wins rich results and AI answer citations.
Get a free, no-obligation SEO audit and a 30-minute strategy session. We'll show you exactly where the growth is hiding.
Fill out the form and we'll get back to you within one business day. Prefer email? Write to us directly at contact@rankite.com.