Do it’s essential redirect a web page or URL in WordPress?
When a consumer follows a hyperlink to your web site that results in a web page that doesn’t exist, they may see an error message. This poor consumer expertise could be irritating on your guests and forestall them from changing into purchasers or clients.
On this article, we’ll present you how one can repair damaged hyperlinks by redirecting pages and URLs in WordPress.
![How to Redirect a Page or URL in WordPress How to Redirect a Page or URL in WordPress](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirect-a-page-or-url-in-wordpress-in-post.png)
Why Redirect a Web page or URL in WordPress?
Hyperlinks allow you to join associated pages in your WordPress web site. They assist guests navigate your web site and permit search engines like google to simply discover and index your content material.
Nevertheless, damaged hyperlinks result in a URL that doesn’t exist in your web site. When this occurs, a irritating 404 ‘Web page Not Discovered’ error message seems.
![404 Page Example 404 Page Example](https://www.wpbeginner.com/wp-content/uploads/2015/03/303wpbeginner404page.png)
![404 Page Example 404 Page Example](https://www.wpbeginner.com/wp-content/uploads/2015/03/303wpbeginner404page.png)
This provides a poor consumer expertise and should negatively impression your web optimization.
It could be that the net web page was deleted, the web page’s URL was modified, or the one that created the hyperlink merely typed the fallacious URL.
Fortunately, you may simply observe 404 errors and redirect the URLs to pages that do exist.
With that being stated, let’s check out how one can redirect a web page or URL in WordPress. We’ll cowl two strategies:
Methodology 1: Creating Redirects Utilizing All in One web optimization (AIOSEO)
The best approach to redirect pages and URLs in WordPress is utilizing the All in One SEO (AIOSEO) WordPress plugin. It’s the finest web optimization plugin for WordPress and provides a strong Redirection Supervisor addon that makes it very simple to arrange redirects.
Observe: You will want AIOSEO Pro to make use of the redirection supervisor. There’s additionally a free version of AIOSEO, but it surely doesn’t embrace 301 redirects.
The very first thing it’s essential do is set up and configure the AIOSEO Professional plugin in your web site. For step-by-step instructions, see our information on how one can arrange All in One web optimization accurately.
After that, you’ll need to activate the Redirect Supervisor addon. Merely go to All in One web optimization » Redirects and click on the ‘Activate Redirects’ button.
![Activate AIOSEO redirects Activate AIOSEO Redirects](https://www.wpbeginner.com/wp-content/uploads/2015/03/303aioseoactivateredirects.png)
![Activate AIOSEO redirects Activate AIOSEO Redirects](https://www.wpbeginner.com/wp-content/uploads/2015/03/303aioseoactivateredirects.png)
Lastly, you’ll need to click on on the ‘Settings’ tab to pick out a redirect technique.
We suggest the ‘PHP’ choice as a result of it’s the easiest and doesn’t require technical configuration of your net server.
![Select the Redirect Method Select the Redirect Method](https://www.wpbeginner.com/wp-content/uploads/2015/03/303aioseosettingsphp.png)
![Select the Redirect Method Select the Redirect Method](https://www.wpbeginner.com/wp-content/uploads/2015/03/303aioseosettingsphp.png)
Now you’re able to redirect your WordPress pages. You are able to do this utilizing the AIOSEO Redirection Supervisor or the WordPress content material editor.
Making a Redirect From the AIOSEO Redirection Supervisor
If you are nonetheless on the All in One web optimization » Redirects web page, you may navigate again to the ‘Redirects’ tab. This web page allows you to handle your redirects and add new ones.
So as to add a brand new redirect, it’s essential add the submit slug of the URL that isn’t working. The slug is the a part of the URL that comes after your web site’s area identify.
Let’s have a look at an instance. The total URL of a submit or web page appears to be like like this:
https://instance.com/old-coffee-link-is-broken/
On this case, the submit slug is the final part of the URL:
/old-coffee-link-is-broken/
It is advisable kind or paste the submit slug of the damaged hyperlink within the ‘Supply URL’ subject like this:
![Enter a Source URL in AIOSEO Redirection Manager Enter a Source URL in AIOSEO Redirection Manager](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-sourceurl.png)
![Enter a Source URL in AIOSEO Redirection Manager Enter a Source URL in AIOSEO Redirection Manager](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-sourceurl.png)
Tip: You may redirect a number of supply URLs to the identical goal URL. Merely click on the ‘Add URL’ button so as to add an additional ‘Supply URL’ subject.
Subsequent, it’s essential enter the submit slug of the present web page that you just want to redirect the URL to. It is advisable kind or paste this into the ’Goal URL’ subject.
![Enter a Target URL in AIOSEO Redirection Manager Enter a Target URL in AIOSEO Redirection Manager](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-targeturl.png)
![Enter a Target URL in AIOSEO Redirection Manager Enter a Target URL in AIOSEO Redirection Manager](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-targeturl.png)
Alternatively, you may merely kind a part of the web page’s title and AIOSEO will present an inventory of matching posts and pages.
When you click on on the proper submit, the slug will likely be entered for you.
![Typing the Title of the Target Page in AIOSEO Redirection Manager Typing the Title of the Target Page in AIOSEO Redirection Manager](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-type-target-page-title.png)
![Typing the Title of the Target Page in AIOSEO Redirection Manager Typing the Title of the Target Page in AIOSEO Redirection Manager](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-type-target-page-title.png)
The final step is to decide on a redirect kind.
Guarantee that the ‘301 Moved Completely’ redirect kind is chosen after which click on the ‘Add Redirect’ button.
![Make Sure the 301 Redirect Type is Selected in AIOSEO Redirection Manager Make Sure the 301 Redirect Type is Selected in AIOSEO Redirection Manager](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-redirecttype.png)
![Make Sure the 301 Redirect Type is Selected in AIOSEO Redirection Manager Make Sure the 301 Redirect Type is Selected in AIOSEO Redirection Manager](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-redirecttype.png)
Now, you may scroll right down to view a log of the redirects you’ve gotten created.
The ‘Hits’ column reveals the quantity of people that visited the redirected hyperlink, and there’s a toggle choice to allow or disable particular person 301 redirects.
![Log of Redirected Pages in AIOSEO Redirection Manager Log of Redirected Pages in AIOSEO Redirection Manager](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-redirects-list.png)
![Log of Redirected Pages in AIOSEO Redirection Manager Log of Redirected Pages in AIOSEO Redirection Manager](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-redirects-list.png)
Making a Redirect From the WordPress Content material Editor
You can too use All in One web optimization to redirect a printed submit or web page if you are modifying it.
While you scroll to the underside of the WordPress editor, you will see an AIOSEO Settings part. It is advisable click on the ‘Redirects’ tab.
![Redirecting a Post or Page From the Content Editor Using AIOSEO Redirecting a Post or Page From the Content Editor Using AIOSEO](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-content-editor.png)
![Redirecting a Post or Page From the Content Editor Using AIOSEO Redirecting a Post or Page From the Content Editor Using AIOSEO](https://www.wpbeginner.com/wp-content/uploads/2024/05/redirectpages-aioseo-content-editor.png)
Right here you will see the identical redirection choices that we coated above. The supply URL has been crammed in for you, and it’s essential add the goal URL.
After that, ensure the ‘301 Moved Completely’ redirect kind is chosen, after which click on the ‘Add Redirect’ button.
A helpful All-in-One web optimization function is that should you change a submit’s permalink whereas modifying it, AIOSEO will routinely redirect the previous URL to the brand new one.
Methodology 2: Creating Redirects Manually by Modifying .htaccess
You can too redirect a web page or URL with out utilizing a plugin. To try this, it’s essential manually add code to your web site’s .htaccess file. This technique is just not appropriate for newcomers as a result of a small mistake can break your web site.
Earlier than utilizing this technique, we strongly suggest making a backup of your .htaccess file.
After that, you may make adjustments to the file utilizing All in One web optimization’s editor device or edit it instantly utilizing FTP or your internet hosting supplier’s file supervisor.
Modifying .htaccess Utilizing All in One web optimization’s .htaccess Editor
The All in One web optimization plugin provides a simple approach to edit your .htaccess file. Nevertheless, you’ll need All in One SEO Pro to make use of the .htaccess editor.
Upon getting put in and configured AIOSEO, merely navigate to the All in One web optimization » Instruments web page. Subsequent, it is best to swap to the ‘.htaccess Editor’ tab.
![Editing .htaccess file using All in One SEO Editing .htaccess File Using All in One SEO](https://www.wpbeginner.com/wp-content/uploads/2015/03/303aioseohtaccess.png)
![Editing .htaccess file using All in One SEO Editing .htaccess File Using All in One SEO](https://www.wpbeginner.com/wp-content/uploads/2015/03/303aioseohtaccess.png)
This web page will present the contents of your .htaccess file. It is advisable paste your redirect code on the backside of the file after the ‘# END WordPress’ line.
Right here is a straightforward redirect the place we try to ship a consumer visiting an previous submit to a brand new submit.
RewriteEngine On
Redirect 301 /thisistheoldurl/ http://yoursite.com/thisisthenewurl/
Be sure you change the previous submit and new submit URLs.
Upon getting carried out this, click on the ‘Save Modifications’ button on the prime of the web page to replace the .htaccess file with the brand new code.
Modifying .htaccess Immediately
You can too edit the .htaccess file instantly with out the necessity for a plugin. To do that, it’s essential hook up with your web site utilizing an FTP consumer or your internet hosting supplier’s file supervisor.
You can see the .htaccess file in your web site’s root listing. When you don’t see it there, then discuss with our information on why you may’t discover .htaccess file in your WordPress web site.
You could possibly edit the file utilizing the file supervisor’s Edit function. In any other case, you may obtain .htaccess to your pc and edit it utilizing a textual content editor like Notepad.
You must paste the next redirect code on the finish of your .htaccess file after the ‘# END WordPress’ line.
RewriteEngine On
Redirect 301 /thisistheoldurl/ http://yoursite.com/thisisthenewurl/
Don’t neglect to vary the previous submit and new submit URLs.
![Edit .htaccess File Edit .htaccess File](https://www.wpbeginner.com/wp-content/uploads/2015/03/303edithtaccessfile.png)
![Edit .htaccess File Edit .htaccess File](https://www.wpbeginner.com/wp-content/uploads/2015/03/303edithtaccessfile.png)
Be sure you save your adjustments, and if vital, add the .htaccess file again to the server.
Now, you may check your redirect to verify it’s redirecting correctly as you supposed.
Professional Guides Associated to Redirection in WordPress
Now that you know the way to redirect pages and URLs, you could wish to see another guides associated to redirection in WordPress:
We hope this tutorial helped you learn to redirect a web page or URL in WordPress. You may additionally need to see our information on the distinction between 302 and 301 redirects, or our professional choose of the very best WordPress redirect plugins.
When you appreciated this text, then please subscribe to our YouTube Channel for WordPress video tutorials. You can too discover us on Twitter and Facebook.
Leave a comment