{"id":365,"date":"2022-04-12T10:26:44","date_gmt":"2022-04-12T10:26:44","guid":{"rendered":"http:\/\/howtotuts.net\/?p=365"},"modified":"2024-07-19T07:12:04","modified_gmt":"2024-07-19T07:12:04","slug":"redirect-url-in-wordpress","status":"publish","type":"post","link":"https:\/\/kwebby.com\/blog\/redirect-url-in-wordpress\/","title":{"rendered":"How to Redirect URL in WordPress: A Comprehensive Guide (4 Methods)"},"content":{"rendered":"\n<p>There are a lot of reasons why you might want to redirect URL in WordPress site. Maybe you\u2019ve changed the permalink structure of your posts and pages and you need to update the old URLs to reflect the new ones. Or maybe you have some old content that you want to delete, but don\u2019t want visitors to be met with a 404 error page when they try to access it.<\/p>\n\n\n\n<p>In any case, URL redirections can be very useful, and in this article, we\u2019ll show you how to set them up in <a href=\"https:\/\/kwebby.com\/blog\/what-wordpress-theme-is-that\/\"  data-wpil-monitor-id=\"341\">WordPress<\/a>.<\/p>\n\n\n\n<p>Also Read: <a href=\"https:\/\/kwebby.com\/blog\/wordpress-sitemap\/\">How to Add Your WordPress Sitemap to Search Engines: A Step-by-Step Guide<\/a><\/p>\n\n\n\n<p>We\u2019ll cover four different methods for URL redirection: manual redirects using .htaccess, automatic redirects using plugins, and two methods for redirecting specific posts and pages.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-is-a-url-redirection\">What is a URL Redirection?<\/h2>\n\n\n\n<p>URL redirection is a method of forwarding a target URL from your source URL. In other words, when someone tries to access the old URL, they will be automatically redirected to the new one.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/Copy-of-Charts-Diagrams-1024x576.jpg\" alt=\"\" class=\"wp-image-11894\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/Copy-of-Charts-Diagrams-1024x576.jpg 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/Copy-of-Charts-Diagrams-300x169.jpg 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/Copy-of-Charts-Diagrams-768x432.jpg 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/Copy-of-Charts-Diagrams-1536x864.jpg 1536w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/Copy-of-Charts-Diagrams-2048x1152.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>For example<\/strong>, if you have a post with the URL <strong>www.example.com\/post-title<\/strong>, but you change the permalink structure of your posts so that the post\u2019s URL is now <strong>www.example.com\/2017\/01\/post-title<\/strong>, you would need to create a URL redirection so that visitors who try to access the old URL are automatically taken to the new one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-would-you-need-to-redirect-a-url\">Why Would You Need to Redirect URL in WordPress?<\/h2>\n\n\n\n<p>There are a few reasons why you might want or need to set up a URL redirection:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/lists-n-checklist-Blog-Banner-1024x576.jpg\" alt=\"\" class=\"wp-image-11895\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/lists-n-checklist-Blog-Banner-1024x576.jpg 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/lists-n-checklist-Blog-Banner-300x169.jpg 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/lists-n-checklist-Blog-Banner-768x432.jpg 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/lists-n-checklist-Blog-Banner-1536x864.jpg 1536w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/lists-n-checklist-Blog-Banner-2048x1152.jpg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To change the permalink structure of your posts and pages without losing traffic from existing links.<\/li>\n\n\n\n<li>To redirect visitors from an old post or page to a new one.<\/li>\n\n\n\n<li>To redirect visitors from a non-www version of your site to the www version (or vice versa).<\/li>\n\n\n\n<li>To fix 404 errors on your WordPress site.<\/li>\n\n\n\n<li>To cloak URLs of your Affiliate Links.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"types-of-redirects\">Types of Redirects<\/h2>\n\n\n\n<p>There are two main types of URL redirections:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/charts-2-Blog-Banner-1024x576.png\" alt=\"\" class=\"wp-image-11896\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/charts-2-Blog-Banner-1024x576.png 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/charts-2-Blog-Banner-300x169.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/charts-2-Blog-Banner-768x432.png 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/charts-2-Blog-Banner-1536x864.png 1536w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/charts-2-Blog-Banner-2048x1152.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>301 redirects<\/strong>: permanent redirects from an old URL to a new one.<\/p>\n\n\n\n<p><strong>302 redirects<\/strong>: temporary redirects, usually used while a website or webpage is under construction.<\/p>\n\n\n\n<p><strong>307 redirects<\/strong>: similar to 302 redirects, but it instructs search engines not to cache the redirected page.<\/p>\n\n\n\n<p><strong>308 redirects<\/strong>: permanent redirect similar to 301 redirect, but it instructs <a href=\"https:\/\/kwebby.com\/blog\/privacy-focused-search-engines\/\"  data-wpil-monitor-id=\"342\">search engines<\/a> not to cache the redirected page.<\/p>\n\n\n\n<p>In general, you\u2019ll want to use 301 redirects for most cases where you need to redirect a URL. They\u2019re the most reliable and they tell search engines that the redirect is permanent, so they\u2019ll update their records accordingly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-a-url-redirect-in-wordpress-using-htaccess\">Create a URL Redirect in WordPress Using .htaccess<\/h2>\n\n\n\n<p>If you\u2019re comfortable working with code, you can create a URL redirect in WordPress by editing your .htaccess file. The .htaccess file is a configuration file for the Apache Web Server, and it\u2019s located in the root directory of your WordPress site.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"find-htaccess-file\">Find .htaccess File<\/h3>\n\n\n\n<p>To edit your .htaccess file, you\u2019ll need to connect to your WordPress site using an FTP client. Once you\u2019re connected, navigate to the \/public_html\/ folder. In most cases, this is the root directory of your WordPress site, but it could be different depending on how your WordPress site is configured.<\/p>\n\n\n\n<p>Once you\u2019re in the \/public_html\/ folder, look for the .htaccess file. If you don\u2019t see it, make sure that you have set your FTP client to show hidden files.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/htaccess-1024x534.png\" alt=\"\" class=\"wp-image-11902\" style=\"width:840px;height:438px\" width=\"840\" height=\"438\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/htaccess-1024x534.png 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/htaccess-300x156.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/htaccess-768x400.png 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/htaccess.png 1220w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/figure>\n\n\n\n<p>Once you find the .htaccess file, right-click on it and select View\/Edit. This will open the file in a text editor so you can edit it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"backup-htaccess-file\">Backup .htaccess File<\/h3>\n\n\n\n<p>Before you make any changes to your .htaccess file, it\u2019s always a good idea to create a backup. To do that, right-click on the .htaccess file and select Download.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"461\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-10-at-10.16.39-PM-1024x461.png\" alt=\"\" class=\"wp-image-11903\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-10-at-10.16.39-PM-1024x461.png 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-10-at-10.16.39-PM-300x135.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-10-at-10.16.39-PM-768x346.png 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/Screenshot-2022-04-10-at-10.16.39-PM.png 1106w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>This will download a copy of the file to your computer so you can restore it if something goes wrong.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-redirects\">Add Redirects<\/h3>\n\n\n\n<p>Before you make any changes to your .htaccess file, it\u2019s always a good idea to back it up. That way, if something goes wrong, you can restore the original file and start over.<\/p>\n\n\n\n<p>To create a URL redirect, you\u2019ll need to add some code to your .htaccess file. The code will look something like this:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Redirect 301 \/old-url\/ http:\/\/example.com\/new-url\/<\/p>\n<\/blockquote>\n\n\n\n<p>Replace \u201cold-url\u201d with the URL you want to redirect, and replace \u201cnew-url\u201d with the URL you want to redirect it to.<\/p>\n\n\n\n<p>For example, if you wanted to redirect www.example.com\/about to www.example.com\/about-us, the code would look like this:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Redirect 301 \/about\/ http:\/\/example.com\/about-us\/<\/p>\n<\/blockquote>\n\n\n\n<p>Once you add the code, save your changes to the .htaccess file and upload it back to your server. That\u2019s all there is to it!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-a-url-redirect-in-wordpress-on-nginx-server\">Create a URL Redirect in WordPress On NGINX Server<\/h2>\n\n\n\n<p>If your WordPress site is running on an NGINX server, then you\u2019ll need a different method to create a URL redirect. Fortunately, it\u2019s still pretty easy to do.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"edit-nginx-config-file\">Edit NGINX Config File<\/h3>\n\n\n\n<p>The first thing you need to do is connect to your WordPress site using an FTP client. Once you\u2019re connected, navigate to the \/etc\/nginx\/ folder. This is where the NGINX configuration file is located.<\/p>\n\n\n\n<p>Or on some servers it may be located on root director \/ www\/server\/nginx\/conf<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"611\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.50.46@2x-1024x611.png\" alt=\"\" class=\"wp-image-11905\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.50.46@2x-1024x611.png 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.50.46@2x-300x179.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.50.46@2x-768x458.png 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.50.46@2x.png 1364w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Once you\u2019re in the \/etc\/nginx\/ folder, look for the nginx.conf file and open it in a text editor.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"backup-nginx-config-file\">Backup NGINX Config File<\/h3>\n\n\n\n<p>Before you make any changes to the <a href=\"https:\/\/www.plesk.com\/blog\/various\/nginx-configuration-guide\/\" target=\"_blank\" rel=\"doFollow noopener\">NGINX configuration file<\/a>, it\u2019s always a good idea to create a backup. To do that, right-click on the nginx.conf file and select Download.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"613\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.52.12@2x-1024x613.png\" alt=\"\" class=\"wp-image-11906\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.52.12@2x-1024x613.png 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.52.12@2x-300x179.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.52.12@2x-768x459.png 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.52.12@2x.png 1364w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>This will download a copy of the file to your computer so you can restore it if something goes wrong.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-redirects\">Add Redirects<\/h3>\n\n\n\n<p>Once you have a backup of the NGINX configuration file, you can start adding your redirects. The code for an NGINX redirect looks like this:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>rewrite ^<strong>\/page\/2\/<\/strong>$ https:\/\/newurl.com\/page\/2\/ permanent;<\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"904\" height=\"432\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.46.30@2x.png\" alt=\"\" class=\"wp-image-11904\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.46.30@2x.png 904w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.46.30@2x-300x143.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.46.30@2x-768x367.png 768w\" sizes=\"auto, (max-width: 904px) 100vw, 904px\" \/><\/figure>\n\n\n\n<p>Replace \u201cold-url\u201d with the URL you want to redirect, and replace \u201cnew-url\u201d with the URL you want to redirect it to.<\/p>\n\n\n\n<p>For example, if you wanted to redirect www.example.com\/about to www.example.com\/about-us, the code would look like this:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>rewrite ^<strong>\/about\/<\/strong>$ https:\/\/example.com\/about-us\/ permanent;<\/p>\n<\/blockquote>\n\n\n\n<p>Save your changes to the NGINX configuration file and upload it back to your server. That\u2019s all there is to it!<\/p>\n\n\n\n<p>As you can see, redirecting a URL in WordPress is pretty easy to do. Whether you\u2019re using an Apache or NGINX server, you can easily add redirects using the .htaccess or NGINX configuration file.<\/p>\n\n\n\n<p>If you want more control over your redirects, or if you need to redirect a large number of URLs, then you may want to consider using a <a href=\"https:\/\/kwebby.com\/blog\/must-have-wordpress-plugins\/\"  data-wpil-monitor-id=\"343\">WordPress plugin<\/a>. We\u2019ll talk more about that in the next section.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"redirect-using-rankmath-plugin\">Redirect Using RANKMATH Plugin<\/h2>\n\n\n\n<p>If you want more control over your redirects, or if you need to redirect a large number of URLs, then you may want to consider using a WordPress plugin.<\/p>\n\n\n\n<p>There are quite a few WordPress plugins that can help you with URL redirects. In this section, we\u2019ll show you how to use the <a href=\"https:\/\/rankmath.com\/wordpress\/plugin\/seo-suite\/?ref=raman\" target=\"_blank\">RANK MATH plugin<\/a> to set up a URL redirect.<\/p>\n\n\n\n<p><a href=\"https:\/\/kwebby.com\/blog\/rankmath-review\/\" data-type=\"post\" data-id=\"15806\">RANK MATH is a popular SEO plugin<\/a> that<a href=\"https:\/\/rankmath.com\/wordpress\/plugin\/seo-suite\/?ref=raman\" target=\"_blank\"> includes a feature for setting up redirects<\/a>. It\u2019s free to use, and it\u2019s pretty easy to set up.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"add-redirect-urls\">Add Redirect URLs<\/h3>\n\n\n\n<p>To get started, install and activate the RANK MATH plugin. For more information, see our step by step guide on how to install a WordPress plugin.<\/p>\n\n\n\n<p>Once the plugin is activated, click on the Redirections tab in the left-hand sidebar. Then click on the Add Redirection button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"508\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.55.38@2x-1024x508.png\" alt=\"\" class=\"wp-image-11907\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.55.38@2x-1024x508.png 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.55.38@2x-300x149.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.55.38@2x-768x381.png 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.55.38@2x-1536x761.png 1536w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.55.38@2x.png 1840w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now, After enabling redirections module of rankmath, it&#8217;s time to add 301 redirection rule in the plugin itself, all you need to click rankmath option on the left and click redirection option in the list and then click &#8220;add new&#8221;;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"507\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.58.53@2x-1024x507.png\" alt=\"\" class=\"wp-image-11908\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.58.53@2x-1024x507.png 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.58.53@2x-300x149.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.58.53@2x-768x380.png 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.58.53@2x-1536x760.png 1536w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-14.58.53@2x.png 1842w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Once you\u2019ve entered the old and new URLs, scroll down and click on the &#8220;Add Redirections&#8221; button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"989\" height=\"1024\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.00.42@2x-989x1024.png\" alt=\"\" class=\"wp-image-11909\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.00.42@2x-989x1024.png 989w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.00.42@2x-290x300.png 290w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.00.42@2x-768x795.png 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.00.42@2x-24x24.png 24w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.00.42@2x.png 1072w\" sizes=\"auto, (max-width: 989px) 100vw, 989px\" \/><\/figure>\n\n\n\n<p>That\u2019s all there is to it! The plugin will handle the rest.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"manage-redirected-urls-in-rankmath\">Manage Redirected URLs in RANKMATH<\/h3>\n\n\n\n<p>If you want to view or edit your redirected URLs, click on the Redirections tab in the left-hand sidebar.<\/p>\n\n\n\n<p>On the Redirections page, you\u2019ll see a list of all the URLs you\u2019ve redirected. You can edit or delete any of the redirects by hovering over them and clicking on the appropriate link.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"308\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.02.11@2x-1024x308.png\" alt=\"\" class=\"wp-image-11910\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.02.11@2x-1024x308.png 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.02.11@2x-300x90.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.02.11@2x-768x231.png 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.02.11@2x-1536x462.png 1536w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-11-at-15.02.11@2x.png 1670w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"redirection-by-john-goodley-wordpress-plugin\">Redirection by John Goodley WordPress plugin<\/h2>\n\n\n\n<p>Redirection is a popular WordPress plugin that can help you with URL redirects. It\u2019s free to use, and it\u2019s pretty easy to set up.<\/p>\n\n\n\n<p>To get started, install and activate the Redirection plugin. For more information, see our step by step guide on how to install a WordPress plugin.<\/p>\n\n\n\n<p>Once the plugin is activated, click on the Redirections tab in the left-hand sidebar. Then click on the Add Redirection button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"882\" height=\"620\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.31.48@2x.png\" alt=\"\" class=\"wp-image-11911\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.31.48@2x.png 882w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.31.48@2x-300x211.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.31.48@2x-768x540.png 768w\" sizes=\"auto, (max-width: 882px) 100vw, 882px\" \/><\/figure>\n\n\n\n<p>After activation, navigate to the tools section of your WordPress and select the &#8220;redirection&#8221; option from it;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"984\" height=\"656\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.33.37@2x.png\" alt=\"\" class=\"wp-image-11912\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.33.37@2x.png 984w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.33.37@2x-300x200.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.33.37@2x-768x512.png 768w\" sizes=\"auto, (max-width: 984px) 100vw, 984px\" \/><\/figure>\n\n\n\n<p>On the next page, you\u2019ll need to enter the old URL and the new URL. You can also choose whether you want to redirect the URL permanently (301) or temporarily (302);<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"882\" height=\"478\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.35.58@2x.png\" alt=\"\" class=\"wp-image-11913\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.35.58@2x.png 882w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.35.58@2x-300x163.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.35.58@2x-768x416.png 768w\" sizes=\"auto, (max-width: 882px) 100vw, 882px\" \/><\/figure>\n\n\n\n<p>Once you\u2019ve entered the old and new URLs, scroll down and click on the Save Changes button.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"edit-your-wordpress-functions-php-file-to-create-a-redirect\">Edit Your WordPress functions.php File to Create a Redirect<\/h2>\n\n\n\n<p>If you want to redirect a URL without using a plugin, then you can edit your WordPress functions.php file to create a redirect.<\/p>\n\n\n\n<p>To get started, connect to your WordPress site using an FTP client. Once connected, go to the \/wp-content\/themes\/your-theme-folder\/ folder.<\/p>\n\n\n\n<p>Alternatively, You can access functions.php file inside your WordPress dashboard from Appearance option &gt; Theme File editor;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"551\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.37.03@2x-1024x551.png\" alt=\"\" class=\"wp-image-11914\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.37.03@2x-1024x551.png 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.37.03@2x-300x162.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.37.03@2x-768x414.png 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.37.03@2x.png 1144w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next, Select your theme first as described below on step 1 and then select the functions.php file;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"418\" src=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.38.18@2x-1024x418.png\" alt=\"\" class=\"wp-image-11915\" title=\"\" srcset=\"https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.38.18@2x-1024x418.png 1024w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.38.18@2x-300x123.png 300w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.38.18@2x-768x314.png 768w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.38.18@2x-1536x627.png 1536w, https:\/\/kwebby.com\/blog\/wp-content\/uploads\/2022\/04\/CleanShot-2022-04-12-at-15.38.18@2x-2048x837.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next, You need to create a backup file by downloading the same from <a href=\"https:\/\/kwebby.com\/blog\/free-wordpress-themes\/\" data-wpil-monitor-id=\"222\">WordPress theme<\/a> file editor panel or from FTP.<\/p>\n\n\n\n<p>From FTP, Inside above folder, you need to find the functions.php file and download it to your computer.<\/p>\n\n\n\n<p>Once the file is downloaded, open it using a text editor like Notepad or TextEdit.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"redirect-the-entire-site-to-a-new-domain\">Redirect the Entire Site to a New Domain<\/h3>\n\n\n\n<p>If you want to <a href=\"https:\/\/kwebby.com\/blog\/set-your-preferred-domain-in-wordpress\/\" data-wpil-monitor-id=\"344\">redirect your entire WordPress site to a new domain<\/a>, then you need to add this code to the functions.php file:<\/p>\n\n\n\n<p>wp_redirect( &#8216;<strong>http:\/\/www.example.com\/&#8217;<\/strong>, 301 );<\/p>\n\n\n\n<p>exit;<\/p>\n\n\n\n<p>Replace <strong>example.com<\/strong> with your new domain name.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"redirect-an-individual-page-or-post-to-a-new-url\">Redirect an Individual Page or Post to a New URL<\/h3>\n\n\n\n<p>If you want to redirect an individual page or post, then you need to add this code to the functions.php file:<\/p>\n\n\n\n<p>You\u2019ll then need to add the following code at the bottom of the file:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>add_action( &#8216;template_redirect&#8217;, &#8216;redirect_to_blog_page&#8217; );<\/p>\n\n\n\n<p>function redirect_to_blog_page() {<\/p>\n\n\n\n<p>&nbsp;&nbsp;if ( is_page(&#8216;<strong>YOUR-SLUG<\/strong>&#8216;) &amp;&amp; ! is_user_logged_in() ) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;wp_redirect( &#8216;<strong>http:\/\/www.newurl.com\/newslug\/<\/strong>&#8216;, 301 );&nbsp;<\/p>\n\n\n\n<p>&nbsp;exit;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>}<\/p>\n<\/blockquote>\n\n\n\n<p>Replace <strong>YOUR-SLUG <\/strong>with the slug of your URL for which you want to be redirected.<\/p>\n\n\n\n<p>Replace <strong>http:\/\/www.newurl.com\/newslug\/<\/strong> with the URL of the page you want to redirect to.<\/p>\n\n\n\n<p>Save the file and upload it back to your server, overwriting the existing file.<\/p>\n\n\n\n<p>That\u2019s all there is to it! The next time someone visits that URL, they will be redirected to the new URL you specified.<\/p>\n\n\n\n<p>Also learn: <a href=\"https:\/\/kwebby.com\/blog\/nginx-vs-apache-web-server\/\">NGINX vs Apache Web Server: Which is best for WordPress in 2022?<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"issues-with-redirections\">Issues With Redirections<\/h2>\n\n\n\n<p>If you are planning to change the URL of your WordPress site, then it\u2019s a good idea to set up redirects from your old URLs to your new URLs. That way, anyone who visits your old URL will be automatically redirected to your new URL.<\/p>\n\n\n\n<p>However, there are a few things you need to be aware of before you set up redirects:<\/p>\n\n\n\n<p>1. Redirections can cause your site to load slowly. This is because each time someone visits a URL on your site, the server has to look up the redirect and then load the new URL.<\/p>\n\n\n\n<p>2. Redirections can also cause issues with search engines. If you set up a redirect from one URL to another, and someone visits the first URL, they will be redirected to the second URL. However, the search engine will still see the first URL.<\/p>\n\n\n\n<p>3. Redirections can also cause issues with your analytics data. If you set up a redirect from one URL to another, and someone visits the first URL, they will be redirected to the second URL. However, your analytics data will show that the visitor visited the first URL, not the second URL.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"seo-issues-with-redirections\">SEO Issues With Redirections<\/h2>\n\n\n\n<p>There are a few SEO issues that you need to be aware of when you set up redirects:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"temporary-redirects\">Temporary Redirects<\/h3>\n\n\n\n<p>If you set up a temporary redirect (302 redirects), then search engines will still index the original URL. However, they will also index the new URL. This can cause duplicate content issues.<\/p>\n\n\n\n<p>To avoid this, you can use a plugin like Yoast SEO to set up a 301 redirect. A 301 redirect is a permanent redirect, which tells search engines that the original URL has been permanently redirected to the new URL.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"redirection-can-cause-broken-internal-links\">Redirection Can Cause Broken internal links<\/h3>\n\n\n\n<p>If you set up a redirect from one URL to another, and someone visits the first URL, they will be redirected to the second URL. However, if there are any internal links pointing to the first URL, they will now be broken.<\/p>\n\n\n\n<p>To avoid this, you can use a plugin like Redirection to set up redirects. This plugin will <a href=\"https:\/\/kwebby.com\/blog\/how-to-add-internal-links-in-wordpress\/\" data-wpil-monitor-id=\"345\">automatically redirect any broken internal links<\/a> to the new URL.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"redirection-can-cause-page-not-found-errors-404\">Redirection Can Cause Page Not Found Errors (404)<\/h3>\n\n\n\n<p>If you set up a redirect from one URL to another, and someone visits the first URL, they will be redirected to the second URL. However, if the second URL does not exist, they will see a 404 page not found error.<\/p>\n\n\n\n<p>To avoid this, you can use a plugin like Redirection to set up redirects. This plugin will automatically redirect any 404 errors to the new URL.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"which-plugins-are-the-best-for-url-redirection-in-wordpress\">Which Plugins are the best for URL Redirection in WordPress?<\/h2>\n\n\n\n<p>There are a few plugins that you can use to set up redirects in WordPress:<\/p>\n\n\n\n<p>1. <strong><a href=\"https:\/\/rankmath.com\/wordpress\/plugin\/seo-suite\/?ref=raman\" target=\"_blank\">RankMath<\/a><\/strong> \u2013 It&#8217;s one of the best all in one SEO plugins which has so many inbuilt functionalities to make your pages search engine optimized.<\/p>\n\n\n\n<p>2. <strong><a href=\"https:\/\/wordpress.org\/plugins\/wordpress-seo\/\" target=\"_blank\">Yoast SEO<\/a><\/strong> \u2013 Yoast is one of the oldest and most popular WordPress plugins which has the functionality of redirection where you can manage it using their intuitive interface.<\/p>\n\n\n\n<p>3. <a href=\"https:\/\/wordpress.org\/plugins\/simple-301-redirects\/\" target=\"_blank\"><strong>Simple 301 Redirects<\/strong> <\/a>\u2013 Free is good right? Simple 301 Redirects is the Free Plugin available in WordPress repository from where you can create and manage all your 301 redirects.<\/p>\n\n\n\n<p>4. <strong><a href=\"https:\/\/wordpress.org\/plugins\/safe-redirect-manager\/\" target=\"_blank\">Safe Redirect Manager<\/a><\/strong> \u2013 Another plugin that is available for free in WordPress Plugin Library to manage all your 3xx&#8217;s redirects in one place. Safe Redirect Manager gets updated regularly to keep your WordPress vulnerability free.<\/p>\n\n\n\n<p>5. <strong><a href=\"https:\/\/wordpress.org\/plugins\/redirection\/\" target=\"_blank\">WP redirection<\/a><\/strong> \u2013 WP Redirection is another option for redirects lovers as it is also available for free at your disposal, You can perform similar tasks as other to create and manage redirects.<\/p>\n\n\n\n<p>6. <strong><a href=\"https:\/\/wordpress.org\/plugins\/redirection\/\" target=\"_blank\">Redirection<\/a><\/strong> \u2013 The plugin is quite popular among bloggers because of its simple functionality and it&#8217;s also lightweight which won&#8217;t make your WordPress Site bloat.<\/p>\n\n\n\n<p>These are just a few of the plugins that you can use to set up redirects in WordPress. There are many more plugins available, both free and premium.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-find-out-if-my-server-runs-on-apache-or-nginx\">How to find out if my server runs on APACHE or NGINX?<\/h2>\n\n\n\n<p>To find out if your server runs on Apache or Nginx, you can use the following steps:<\/p>\n\n\n\n<p>1. Open your hosting account&#8217;s cPanel interface and look for the Websites section.<\/p>\n\n\n\n<p>2. Under the Websites heading, click on the Domains icon.<\/p>\n\n\n\n<p>3. In the new page that opens up, scroll down to the bottom and look for the Server Information section.<\/p>\n\n\n\n<p>4. The web server type will be listed under this section. If it says Apache, then your server runs on Apache. If it says Nginx, then your server runs on Nginx.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"url-redirections-with-or-without-plugin-what-do-i-recommend\">URL Redirections With or Without Plugin, What do I recommend?<\/h2>\n\n\n\n<p>There are two ways that you can go about URL redirection in WordPress. You can either use a plugin, or you can do it without a plugin. I personally recommend doing it without a plugin, because it is much simpler and easier for one or 2 URL Redirects.<\/p>\n\n\n\n<p>However, If you want to use URL Redirection for marketing purposes or there will be dozens of redirections then I recommend you to use a WordPress Plugin like RANKMATH to create and manage your URL Redirection.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion&nbsp;<\/h2>\n\n\n\n<p>In this article, we have looked at how to redirect URL in WordPress. We have also looked at the benefits and drawbacks of using a plugin for URL redirection. Lastly, we have looked at how to find out if your server runs on Apache or Nginx.<\/p>\n\n\n\n<p>I hope you found this article helpful. If you have any questions, please feel free to leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are a lot of reasons why you might want to redirect URL in WordPress site. Maybe you\u2019ve changed the permalink structure of your posts&hellip;<\/p>\n","protected":false},"author":1,"featured_media":11917,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[100,404],"tags":[482,483,484,485,486],"class_list":["post-365","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-wordpress-tutorials","tag-301-redirection","tag-404-redirection","tag-url-redirection","tag-wordpress-redirection","tag-wordpress-url-redirection"],"_links":{"self":[{"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/posts\/365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/comments?post=365"}],"version-history":[{"count":4,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/posts\/365\/revisions"}],"predecessor-version":[{"id":22503,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/posts\/365\/revisions\/22503"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/media\/11917"}],"wp:attachment":[{"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/media?parent=365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/categories?post=365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kwebby.com\/blog\/wp-json\/wp\/v2\/tags?post=365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}