Guide
How to set up 301 redirects, step by step
A 301 redirect is a permanent instruction that sends visitors and search engines from an old web address to a new one. You set it up in your hosting control panel, in a .htaccess file, or with a WordPress plugin. Use one whenever you change a page address, move to a new domain or merge pages, so you keep your visitors and most of your search ranking.
How it works
What happens when someone visits an old address
- Visitor asksThey request /old-page/
- Server answers 301It says: moved permanently
- Browser followsIt requests /new-page/
- New page loadsVisitor sees the right content
- Search engine learnsIt updates its index over time
The basics
What a 301 redirect actually is
Every time a browser asks a server for a page, the server replies with a status code. A normal page returns 200, which means "here it is". A missing page returns 404. A 301 means "moved permanently": the content you wanted now lives at another address, and here is where to find it. Browsers follow it automatically, so the visitor usually notices nothing apart from a changed address bar.
The word "permanent" matters to search engines. It tells them to treat the new address as the real one, to show it in results and to carry over most of the old page's standing. A 302 redirect, by contrast, says the move is temporary, so search engines keep the old address in their index. Choosing the right one avoids confusing Google.
Redirects are not a trick. They are the polite, standard way to say that something has moved. Without them, anyone with a bookmark, an old link or a result in Google lands on an error page, and many will not try again.
Codes
Common redirect and status codes
| Code | Meaning | Use it when |
|---|---|---|
| 200 | OK, page found | Normal pages |
| 301 | Moved permanently | An address has changed for good |
| 302 | Found, temporary move | A short-term redirect, such as a maintenance page |
| 307 and 308 | Temporary and permanent redirects that keep the request method | Technical cases such as form submissions |
| 404 | Not found | The page has gone and has no replacement |
| 410 | Gone | The page was deliberately removed for good |
Move your site without losing visitors
Free migration is included on Small and higher plans billed yearly.
When to use one
Situations that call for a 301
You changed a page URL
If /services/plumbing/ becomes /plumbing/, redirect the old address to the new one.
You moved to a new domain
Redirect every old page to its matching page on the new domain. See moving a website.
You moved from HTTP to HTTPS
Send every HTTP address to its HTTPS twin. See HTTP to HTTPS.
You merged or removed pages
Send the old page to the closest useful replacement, not always the homepage.
You want one canonical version
Choose www or non-www and redirect the other to it.
You fixed a typo in a URL
Keep the old misspelt address working so existing links still land.
Method 1
Setting up redirects in your hosting control panel
The easiest method for most people is the redirects tool in the hosting control panel. You choose the type, which should be permanent (301), pick the domain, type the old path, such as /old-page/, and enter the full destination address. Save it, then test it by visiting the old address in a private browser window.
Control panel redirects are good for a handful of changes. They are easy to read and to remove later, and they do not need you to touch any code. If you find yourself adding dozens, a rule in .htaccess or a plugin with a spreadsheet import is more manageable.
Method 2
Setting up a 301 in the .htaccess file
Back up first
Download a copy of your existing .htaccess file. A single wrong character can take the whole site offline, and a copy lets you undo it.
Open the file
Use the file manager or SFTP to open the .htaccess file in your site's main folder. It is hidden by default, so enable hidden files.
Add a rule
For one page, add a line such as: Redirect 301 /old-page/ https://www.example.co.uk/new-page/
Save and upload
Save the file in plain text with no extra extension, and put it back in the same folder.
Test straight away
Visit the old address in a private window. Check you land on the new page and that the rest of the site still works.
Method 3
Redirects in WordPress
In WordPress, a redirect plugin gives you a friendly screen where you type the old and new addresses, and it can log 404 errors so you see which old links people are still using. Several SEO plugins also include a redirect manager. Choose one tool and stick to it, so you are not hunting through three places when something goes wrong.
WordPress also redirects by itself when you change a post's slug, in many cases, but do not rely on it for important pages. Add an explicit redirect if the old address ever had traffic or links. For bulk changes, such as a site redesign that renames dozens of pages, prepare a spreadsheet of old and new addresses first, and import it into the plugin.
Doing it well
Good and poor redirect habits
Good habits
- Redirect each old page to the most relevant new page
- Keep redirects in place for at least a year
- Test every redirect after saving
- Keep a list of what points where
- Update internal links to the new address
Poor habits
- Sending every old page to the homepage
- Chaining one redirect into another into another
- Creating loops where A leads to B and B back to A
- Using 302 when the move is permanent
- Deleting redirects after a few weeks
Troubleshooting
When a redirect does not work
| Symptom | Likely cause | Fix |
|---|---|---|
| Page still shows the old content | Browser or cache holds the old copy | Test in a private window and clear the cache |
| Browser says too many redirects | A loop, or www and HTTPS rules fighting | Remove duplicate rules and test one at a time |
| Site shows a server error after editing | A typo in .htaccess | Restore your backed-up copy |
| Redirect works for some pages only | A rule order problem or a missing trailing slash | Match the exact old path, including the slash |
| Search results still show old address | Search engines take time to update | Be patient and submit the new sitemap |
Rankings
What redirects do and do not do for search
A correct 301 passes the great majority of the old page's search value to the new one, but the change is not instant. Search engines need to crawl the old address, see the redirect and update their index, which can take weeks. Traffic may dip slightly during that time even when everything is done properly, so avoid making other big changes in the same week.
Do not use redirects to hide thin or unrelated pages. Redirecting a deleted page to an unrelated one is treated as a soft error by search engines. If a page has truly gone with no replacement, a clear 404 page that offers navigation is better than a misleading redirect.
FAQ
Common questions
What is the difference between a 301 and a 302?
A 301 is permanent, so search engines move to the new address. A 302 is temporary, so they keep the old one.
Will a 301 redirect hurt my SEO?
Done correctly it keeps most of your search value. Mistakes such as loops, chains and redirecting everything to the homepage can hurt.
How long should I keep a redirect?
Keep it for at least a year, and longer if the old address still receives traffic or has external links.
Can I redirect a whole domain?
Yes. Redirect each old page to its matching page on the new domain, and the root domain to the new homepage.
Where is the .htaccess file?
It sits in your site's main folder and is hidden by default, so turn on hidden files in the file manager or SFTP client.
Keep reading
Related pages
Move or rebuild your site with confidence
Free migration on Small and higher plans billed yearly, and live chat open 24/7.