You changed a URL. Maybe you restructured your blog categories, moved to a new domain, or merged two similar posts into one. The old URL still exists in Google’s index, in other sites’ links, in bookmarks, and in emails you sent six months ago. Without a redirect, every one of those links leads to a 404 page.
A 301 redirect tells browsers and search engines: “This page has permanently moved to a new address.” The visitor lands on the right page without noticing anything happened. Search engines transfer the old URL’s ranking authority to the new one. Backlinks keep working. Bookmarks keep working. Nothing breaks.
This guide covers four ways to set up 301 redirects: through a WordPress plugin, by editing your
.htaccess
file, through your hosting control panel, and for full domain moves.
301 vs 302: permanent vs temporary#
Before setting anything up, make sure you’re using the right redirect type.
301 (Permanent). The page has moved forever. Search engines stop indexing the old URL and transfer its ranking signals to the new one. Use this when you’ve changed a URL and the old one will never come back.
302 (Temporary). The page has moved for now but will return to its original location. Search engines keep the old URL indexed. Use this during maintenance, A/B testing, or when you’re temporarily serving content from a different location.
If you’re unsure, use 301. The vast majority of redirects in WordPress are permanent. Using a 302 when you mean 301 doesn’t break anything for visitors, but search engines won’t transfer ranking authority to the new URL, which defeats one of the main purposes of redirecting.
Why 301 redirects matter for SEO#
When a page accumulates backlinks, search ranking authority, and traffic over time, that value is tied to its URL. Change the URL without a redirect, and all of that is lost. The old URL returns 404, backlinks become dead ends, and search engines treat the new URL as a brand new page with zero history.
A 301 redirect preserves that investment:
Link equity transfers. Google and other search engines pass ranking signals from the old URL to the new one. The new page inherits the authority of the old page, which means your search rankings stay intact instead of starting over.
Backlinks keep working. Every external site that linked to your old URL now sends visitors to the correct page instead of a 404. You keep the traffic and the SEO value of those links.
No duplicate content. If both the old and new URLs serve the same content without a redirect, search engines may see it as duplicate content and struggle to decide which version to rank. A 301 redirect eliminates the ambiguity.
Users land where they should. Someone clicks an old link from a social media post, an email newsletter, or a Google search result. Instead of hitting a dead end, they get the content they were looking for.
Method 1: WordPress plugin#
The simplest approach if you’re not comfortable editing server configuration files. The Redirection plugin is free, well-maintained, and handles everything most sites need.
Setup
- In your WordPress dashboard, go to Plugins > Add New
- Search for “Redirection” (by John Godley)
- Install and activate it
- Go to Tools > Redirection and run the setup wizard
Adding a redirect
- In the Redirection interface, you’ll see an “Add new redirection” form
- Source URL: Enter the old path (e.g.,
/old-blog-post/) - Target URL: Enter the new full URL (e.g.,
https://yourdomain.com/new-blog-post/) - The default type is 301 (permanent). Change it in the group settings if you need 302.
- Click Add Redirect
The redirect takes effect immediately. No server restart needed since the plugin handles it at the WordPress level.
When to use a plugin
Plugins work well for small to moderate numbers of redirects (a few dozen to a few hundred). They’re easy to manage, require no technical knowledge, and keep a log of redirect hits so you can see which old URLs are still receiving traffic.
The downside: the redirect is processed by PHP and WordPress on every request, which adds a small amount of overhead. For sites with thousands of redirects or very high traffic, server-level redirects (methods 2-3) are more efficient.
Method 2: .htaccess file (Apache servers)#
If your site runs on Apache, you can add redirects directly to the
.htaccess
file. These are processed by the web server before PHP loads, making them faster than plugin-based redirects.
Single page redirect
Connect to your site via FTP, SFTP, or your hosting file manager. Open the
.htaccess
file in your WordPress root directory and add:
Redirect 301 /old-page/ https://www.yourdomain.com/new-page/
Place this before the WordPress rewrite rules (the block starting with
# BEGIN WordPress
). The old path is relative to your domain root. The destination is a full URL.
Multiple redirects
Add one line per redirect:
Redirect 301 /old-page-one/ https://www.yourdomain.com/new-page-one/
Redirect 301 /old-page-two/ https://www.yourdomain.com/new-page-two/
Redirect 301 /blog/outdated-post/ https://www.yourdomain.com/blog/updated-post/
Redirect an entire domain
If you’ve moved your site to a new domain and want all URLs to forward:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain\.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.olddomain\.com [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301,NC]
This preserves the URL path. A visitor going to
olddomain.com/blog/my-post/
ends up at
newdomain.com/blog/my-post/
. Search engines update their index accordingly.
Important notes for .htaccess
- Always back up your
.htaccessfile before editing. A syntax error can take your entire site down. -
.htaccessonly works on Apache servers. If your host uses Nginx (including Hostney), this file has no effect on redirects. Use method 3 instead. - Apache’s
Redirectdirective automatically appends query strings to the destination URL.
Method 3: Hosting control panel (Hostney)#
If your site is hosted on Hostney, you can set up redirects through the control panel without touching any configuration files. The redirects are applied at the Nginx server level, which is the fastest method since they’re processed before WordPress or PHP are involved.
Adding a redirect
- Sign in at my.hostney.com
- Navigate to Hosting > Redirects (301 / 302)
- In the “Add redirect” section:
- Website: Select the website (subdomain) from the dropdown
- Source path: Enter the old URL path (e.g.,
/old-page/). The domain prefix is shown automatically. - Type: Select 301 (permanent) or 302 (temporary)
- Destination URL: Enter the full destination URL (e.g.,
https://yourdomain.com/new-page/)
- Toggle the preview to see how the redirect will be formatted
- Click Save redirect
Changes take 1-2 minutes to apply as the server configuration regenerates.
Managing existing redirects
All your redirects appear in a searchable, sortable table below the form. You can filter by website, source path, destination, or type. To remove a redirect, click the dropdown menu on the row and select Delete, then confirm.
How it works under the hood
Hostney generates an Nginx
location = /path
block for each redirect with a
return 301
or
return 302
directive. This is exact-path matching at the web server level, processed before PHP ever loads. It’s the most efficient redirect method available.
What it supports
- 301 and 302 redirects per website (subdomain)
- Exact path matching (e.g.,
/old-page/redirects exactly that path) - Any destination URL (can redirect to a different domain, subdomain, or path)
- Duplicate prevention (can’t create two redirects for the same source path on the same website)
What it doesn’t support
- Wildcard or regex patterns (e.g.,
/blog/*to redirect all blog posts). For pattern-based redirects, use a WordPress plugin or custom Nginx configuration. - Query string matching in the source path. Redirects match on the path only.
For most WordPress redirect needs (changed slugs, merged posts, reorganized categories), exact-path matching covers the use case. If you need pattern-based redirects for a domain migration with hundreds of URLs, a combination of the control panel for key pages and a plugin for bulk patterns works well.
Common redirect scenarios#
Changed a post or page URL
You updated a slug from
/blog/old-title/
to
/blog/better-title/
. Add a single 301 redirect from the old path to the new URL. This is the most common use case.
Merged two posts into one
You had two similar posts covering the same topic. You merged them into a stronger, more comprehensive post. Redirect both old URLs to the new combined post. Both sets of backlinks and search authority now point to one page.
Moved from HTTP to HTTPS
If you installed an SSL certificate and your site now runs on HTTPS, redirect all HTTP traffic to HTTPS. This is usually handled at the server level by your hosting provider. On Hostney, HTTPS redirection is automatic with your free SSL certificate.
Changed your domain name
You moved from
oldsite.com
to
newsite.com
. Set up domain-wide redirects so every URL on the old domain forwards to the equivalent path on the new domain. This requires server-level configuration (
.htaccess
on Apache, or contact your host for Nginx).
Deleted a page with no replacement
If you’ve removed a page and there’s no equivalent replacement, redirect to the most relevant existing page rather than letting it 404. The homepage or a parent category page is often the best choice. This preserves whatever link equity the deleted page had.
Mistakes to avoid#
Redirect chains. A redirects to B, which redirects to C, which redirects to D. Each hop adds latency and dilutes SEO value. Always redirect directly to the final destination.
Redirect loops. Page A redirects to page B, and page B redirects back to page A. The browser gets stuck in an infinite loop and eventually shows an error. Before adding a redirect, check that the destination doesn’t already redirect somewhere else.
Forgetting to update internal links. Redirects are for external links and search engines that you can’t control. For links within your own site (navigation menus, in-content links, footer links), update them to point directly to the new URL. Don’t rely on redirects for internal navigation since they add unnecessary server roundtrips.
Removing redirects too early. Keep 301 redirects in place for at least a year, ideally indefinitely. Search engines need time to process the change, and old links in emails, social posts, and other websites will continue using the old URL for a long time.
Using 302 when you mean 301. A 302 tells search engines the move is temporary, so they keep the old URL in their index and don’t transfer ranking authority. If the move is permanent, use 301.
For more on how Google handles redirects, see the Google Search documentation on redirects.
Try Hostney web hosting free for 14 days. Manage 301 and 302 redirects directly from your control panel with server-level Nginx performance.