I put together a handy Google Sheet a couple of years ago to help you quickly generate the code for all sorts of 301 redirects on Apache servers. It’s still a great tool, and for anyone who missed it, I wanted to share it again.
⚠️ Before You Start: Read This
A little excitement is great, but a word of caution. One mistake in your .htaccess
file can take your entire website offline. Even if you’re a seasoned pro, always download and save a copy of your current .htaccess
file before making changes. If things go sideways, just restore your original file via your hosting control panel or FTP client.
Seriously, do not skip the backup. If you crash your site, don’t say I didn’t warn you.
Now, about the sheet…
- Need to redirect one URL to another on your site? Covered.
- Want to send visitors from an old domain to a new one? Done.
- Pointing a specific page to a completely different website? Easy.
Just plug in your details and copy the code. No guesswork.
🎥 Watch how it works: YouTube video walkthrough
Why Not Use a Redirect Plugin Instead?
You might be thinking,
“But Mike, my SEO plugin (Yoast, Rankmath, SEOPress, etc.) handles redirects for me!”
Here’s why I don’t recommend relying on plugins for redirects:
- Not all plugins do it right. Some handle redirects on the front-end (slower), instead of on the server (faster).
- Plugins can break. If your redirect plugin fails or gets disabled, you could lose all your redirects.
- More plugins = more problems. Extra plugins add bloat and can open up new security risks.
- Slight Performance Overhead: Redirects happen after WordPress loads, so they’re not quite as fast as .htaccess redirects, but for most sites, this difference is negligible.
Bottom line: Whenever possible, manage your redirects at the server level. It’s faster and more reliable.
A Few Quick Tips for Using the Sheet
- Make your own copy: Go to File > Make a copy. This lets you edit and use the sheet however you want.
- Multi-line code outputs: If the code you copy has quotes around it, just delete them. (Google Sheets adds quotes when copying multiple lines—annoying, but unavoidable.)
- Don’t duplicate “RewriteEngine on”: If your .htaccess file already includes
RewriteEngine on
, skip that line and just use the rest of the code.
That’s it. No more guesswork. No risky plugins.
Grab the sheet, watch the video, and get your redirects sorted the right way!