At times, everyone with a website will inevitably migrate pages — from your old website to a new one. Some clients might even need to change the directory on a WordPress installation. Other times, their site just has messy URLs … or even a nightmare content structure that just needs to be reworked.
URL redirection in WordPress is very important. You want people to always be able to find relevant content when the click on any link to your site. To handle 301 redirection notifications, to keep track of 404 errors, and to generally tidy up any loose ends your site may have, you need to use proper redirects.
What you need to have for redirects:
- 404 error monitoring – if you have pages that are erroring out—you want to know about it!
- custom pass through – this allows you to customize the redirection on a URL through other pages, files, or even to another site
- a forever log of your redirected URLs – trust me, it’s better to keep these just in case
- redirect based on referrer – it’s nice to be able to pick where to redirect someone based on who sent them to you (the referrer)
- 301 redirects – you want to make sure any pages no longer relevant are delivering up the right current content
Should I use a plugin or .htaccess?
If you want to make your life easier, just use a plugin. It just promotes ease of use. We really like Redirection, since it helps redirects to be automatically created when a post URL changes. It’s a lot easier to manually add redirections than to hack around a .htaccess—especially if you’re not terribly comfortable getting your hands dirty in the code. The Redirection plugin also give you the added benefit of being able to keep track of 404 errors.
Nice features that we like on the Redirection plugin:
- Automatically add a 301 redirection when a post’s URL changes
- Manually add 301, 302, and 307 redirections for a WordPress post, or for any other file
- Full regular expression support
- Apache .htaccess is not required – works entirely inside WordPress
- Redirect index.php, index.html, and index.htm access
- Redirection statistics telling you how many times a redirection has occurred, when it last happened, who tried to do it, and where they found your URL
- Fully localized
Here at Wooster Creative, we appreciate the WordPress plugin dev John Godley at Redirection. Their contribution makes getting those error messages on a website just a little more pleasant and worry-free.