{"id":12956,"date":"2025-05-12T16:45:25","date_gmt":"2025-05-12T16:45:25","guid":{"rendered":"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/"},"modified":"2025-05-12T16:45:25","modified_gmt":"2025-05-12T16:45:25","slug":"how-to-create-htaccess-redirects-most-common-use-cases","status":"publish","type":"post","link":"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/","title":{"rendered":"How to Create .htaccess Redirects (Most Common Use Cases)"},"content":{"rendered":"<p>Whenever you move content, change domain names, or simply tweak a page\u2019s URL, you\u2019ll likely use a redirect. This ensures your users (and Google) get to the right page, and it preserves the SEO value from your backlinks.<\/p>\n<p>You can use .htaccess redirects specifically to do this.<\/p>\n<p>But I get that messing with your site\u2019s server files can sound daunting.<\/p>\n<p>So the goal of this guide is to make .htaccess redirects as accessible as possible.<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p>To help, there are two free resources you\u2019ll find in this post:<\/p>\n<ol>\n<li>A <a title=\"Cheat Sheet for .htaccess Redirects\" href=\"https:\/\/docs.google.com\/spreadsheets\/u\/0\/d\/1n9-naLQeQhAYxCAfU0vhd7RhpnN-AY5JnzczseQQfb4\/copy\" target=\"_blank\" rel=\"noopener\">simple spreadsheet<\/a> to automatically generate rules for the most common scenarios<\/li>\n<li>An <a title=\".htaccess Redirect Symbols Cheat Sheet\" href=\"https:\/\/docs.google.com\/document\/d\/1WV9lPhkZb74ytE4ukGS1Ps0mIt-0j5g5HLccARwOaxQ\/copy\" target=\"_blank\" rel=\"noopener\">.htaccess redirect cheat sheet<\/a> that explains all symbols and flags used in redirect rules<\/li>\n<\/ol>\n<p>I\u2019ll explain when to use these below. But if you want, you can download them now and follow along with the resources.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Here\u2019s the plan:<\/p>\n<ul>\n<li>We\u2019ll start with a walkthrough to find your .htaccess file and get ready to make changes (feel free to skip this part if you have it ready to go)<\/li>\n<li>We\u2019ll then go through the most common .htaccess redirect use cases in detail<\/li>\n<li>Then we\u2019ll go through a cheat sheet of the symbols and flags you can use to build custom .htaccess rules<\/li>\n<li>Finally, we\u2019ll show you how to make sure everything is working properly and how to pinpoint issues<\/li>\n<\/ul>\n<p>Sound good? Let\u2019s go.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#How_to_Set_Up_htaccess_Redirects\" >How to Set Up .htaccess Redirects<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Editing_htaccess_Through_Your_Hosting_Control_Panel\" >Editing .htaccess Through Your Hosting Control Panel<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Via_FTP\" >Via FTP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#What_About_WordPress\" >What About WordPress?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Before_You_Begin_Important_Prerequisites\" >Before You Begin: Important Prerequisites<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#How_to_Redirect_a_Single_URL\" >How to Redirect a Single URL<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Single_URL_Redirect_Example\" >Single URL Redirect Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Permanent_vs_Temporary_Redirects\" >Permanent vs. Temporary Redirects<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#How_to_Redirect_a_Subfolder\" >How to Redirect a Subfolder<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Subfolder_Redirect_Example\" >Subfolder Redirect Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Important_Order_Matters\" >Important: Order Matters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Redirecting_a_Subfolder_to_a_Different_Domain\" >Redirecting a Subfolder to a Different Domain<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#How_to_Redirect_to_a_New_Domain\" >How to Redirect to a New Domain<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Domain_Redirect_Example\" >Domain Redirect Example<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Redirect_www_to_Non-www_or_Vice_Versa_on_New_Domain\" >Redirect www to Non-www (or Vice Versa) on New Domain<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#How_to_Redirect_HTTP_to_HTTPS\" >How to Redirect HTTP to HTTPS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#How_to_Redirect_WWW_to_Non-WWW\" >How to Redirect WWW to Non-WWW<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#What_About_Non-WWW_to_WWW\" >What About Non-WWW to WWW?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Other_Types_of_htaccess_Redirect\" >Other Types of .htaccess Redirect<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Redirect_Based_on_Query_Parameters\" >Redirect Based on Query Parameters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Redirect_to_a_Specific_Port\" >Redirect to a Specific Port<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Custom_Error_Page_Redirects\" >Custom Error Page Redirects<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Temporary_vs_Permanent_Redirects\" >Temporary vs. Permanent Redirects<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Redirecting_Specific_File_Types\" >Redirecting Specific File Types<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Redirect_to_Force_Trailing_Slash\" >Redirect to Force Trailing Slash<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Htaccess_Redirects_Symbols_Explained_Cheat_Sheet\" >Htaccess Redirects Symbols Explained (+ Cheat Sheet)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Common_htaccess_Symbols\" >Common .htaccess Symbols<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Flag_Options\" >Flag Options<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#RewriteCond_Variables\" >RewriteCond Variables<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Pattern_Matching_Examples\" >Pattern Matching Examples<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#URL_Paths\" >URL Paths<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#File_Types\" >File Types<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Flag_Variations\" >Flag Variations<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Variable_Conditions\" >Variable Conditions<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#How_to_Check_Your_Redirects_Are_Working\" >How to Check Your Redirects Are Working<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-36\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Manual_Testing\" >Manual Testing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-37\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Online_Redirect_Checkers\" >Online Redirect Checkers<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-38\" href=\"https:\/\/craighordlow.com\/index.php\/2025\/05\/12\/how-to-create-htaccess-redirects-most-common-use-cases\/#Testing_Multiple_URLs\" >Testing Multiple URLs<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Set_Up_htaccess_Redirects\"><\/span>How to Set Up .htaccess Redirects<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Before you can create <a title=\"Redirects 101: A Beginner\u2019s Guide to Setup &amp; Best Practices\" href=\"https:\/\/backlinko.com\/redirects\" target=\"_blank\" rel=\"noopener\">redirects<\/a>, you need to access your .htaccess file. This file lives on your server and controls various aspects of how your website behaves.<\/p>\n<p>It looks something like this (for a WordPress site in particular):<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"htaccess \u2013 File Example\" alt=\"htaccess \u2013 File Example\" data-aspect-ratio=\"0.88571428571429\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/04\/htacces-file-example.png\" loading=\"lazy\" \/><\/p><\/figure>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Note:<\/strong> You\u2019ll only have an .htaccess file if your website runs on an Apache web server. If you\u2019re not sure if your site does, get in touch with your developer.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>There are two main ways to access and edit your .htaccess file:<\/p>\n<ul>\n<li>Through your hosting provider\u2019s control panel<\/li>\n<li>Via an FTP client<\/li>\n<\/ul>\n<p>I\u2019d personally recommend the first option if you\u2019re an absolute beginner. Or if you just want to keep the technical stuff to a minimum.<\/p>\n<p>That\u2019s not to say that using an FTP client is difficult (or that every hosting platform is a piece of cake to navigate). But generally, your file manager is going to be a bit more intuitive.<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/03\/icon-remember-v2.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Important:<\/strong> Regardless of which method you use, always make a backup of your .htaccess file before editing it. One small mistake can bring your entire site down.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/03\/icon-remember-v2.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Editing_htaccess_Through_Your_Hosting_Control_Panel\"><\/span>Editing .htaccess Through Your Hosting Control Panel<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Most major hosting providers offer a file manager in their control panel that lets you edit files directly.<\/p>\n<p>The general workflow looks something like this, although some of the specifics might vary between hosts:<\/p>\n<ol>\n<li>Log in to your hosting account<\/li>\n<li>Find the File Manager (usually in cPanel or a similar dashboard)<\/li>\n<li>Navigate to your website\u2019s root directory (often called public_html)<\/li>\n<li>Find the .htaccess file<\/li>\n<\/ol>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Note:<\/strong> Your .htaccess file might be hidden by default. If you don\u2019t see it, look for an option to \u201cShow Hidden Files\u201d in your file manager settings.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Once you find it, you can usually right-click and select \u201cEdit\u201d to make changes.<\/p>\n<p>As an example, here\u2019s how the interface looks in the cPanel platform. First, I navigate to my domain\u2019s website dashboard and find the file manager:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"cPanel \u2013 File Manager\" alt=\"cPanel \u2013 File Manager\" data-aspect-ratio=\"0.50857142857143\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/07\/cpanel-file-manager.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>And in there I can see public_html:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"cPanel \u2013 File Manager \u2013 Files\" alt=\"cPanel \u2013 File Manager \u2013 Files\" data-aspect-ratio=\"0.80857142857143\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/07\/cpanel-file-manager-files.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>I then click my .htaccess file:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"File Manager \u2013 htaccess\" alt=\"File Manager \u2013 htaccess\" data-aspect-ratio=\"0.62\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/03\/file-manager-htaccess.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>Simple.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Via_FTP\"><\/span>Via FTP<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You can also use an FTP client like <a title=\"FileZilla\" href=\"https:\/\/filezilla-project.org\/\" target=\"_blank\" rel=\"noopener\">FileZilla<\/a>, <a title=\"Cyberduck\" href=\"https:\/\/cyberduck.io\/\" target=\"_blank\" rel=\"noopener\">Cyberduck<\/a>, or <a title=\"WinSCP\" href=\"https:\/\/winscp.net\/eng\/download.php\" target=\"_blank\" rel=\"noopener\">WinSCP<\/a>. These give you similar access, but you can do it directly rather than through your hosting provider.<\/p>\n<p>To get started, download and install an FTP client. We\u2019ll go with Cyberduck for the example below.<\/p>\n<p>Then connect to your server using your FTP credentials (your host can provide these \u2014 mine were under <strong>Files &gt; FTP Accounts<\/strong>):<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"FTP Protocol \u2013 Popup\" alt=\"FTP Protocol \u2013 Popup\" data-aspect-ratio=\"0.61142857142857\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/04\/ftp-protocol-popup.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>Then, within the FTP client, navigate to your site\u2019s root directory.<\/p>\n<p>It\u2019s probably named public_html, which may open automatically. Then, find and download your .htaccess file:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"FTP \u2013 File Manager\" alt=\"FTP \u2013 File Manager\" data-aspect-ratio=\"0.58285714285714\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/04\/ftp-file-manager.png\" loading=\"lazy\" \/><\/p><\/figure>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Note:<\/strong> I had to go to <strong>View &gt; Show hidden files<\/strong> to see mine. No matter which FTP client you\u2019re using, there\u2019s a good chance you\u2019ll need to do the same. <\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Make your changes in a text editor, and then upload the modified file back to the server. You might be able to skip the download\/upload step and make edits directly, depending on the tool you use:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"FTP Protocol \u2013 Edit With\" alt=\"FTP Protocol \u2013 Edit With\" data-aspect-ratio=\"0.73\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/04\/ftp-protocol-edit-with.png\" loading=\"lazy\" \/><\/p><\/figure>\n<h3><span class=\"ez-toc-section\" id=\"What_About_WordPress\"><\/span>What About WordPress?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you\u2019re running a WordPress site, you usually don\u2019t need to edit your .htaccess file to set up redirects.<\/p>\n<p>Instead, you can use dedicated redirect plugins like <a title=\"Redirection\" href=\"https:\/\/en-gb.wordpress.org\/plugins\/redirection\/\" target=\"_blank\" rel=\"noopener\">Redirection<\/a> or <a title=\"301 Redirects\" href=\"https:\/\/wordpress.org\/plugins\/eps-301-redirects\/\" target=\"_blank\" rel=\"noopener\">301 Redirects<\/a>.<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"301 Redirects \u2013 Redirect Rules\" alt=\"301 Redirects \u2013 Redirect Rules\" data-aspect-ratio=\"0.29285714285714\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/03\/301-redirects-redirect-rules.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>These plugins are perfect if you\u2019re not comfortable editing server files or if you just need to set up a couple of redirects quickly. But they won\u2019t help you much for more complex redirections or when you\u2019re performing a full site migration.<\/p>\n<p>Other SEO plugins, like <a title=\"Rank Math SEO \u2013 AI SEO Tools to Dominate SEO Rankings \u2013 WordPress plugin\" href=\"https:\/\/wordpress.org\/plugins\/seo-by-rank-math\/\" target=\"_blank\" rel=\"noopener\">Rank Math<\/a>, offer redirect managers alongside options to edit your .htaccess file within the WordPress dashboard:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Rank Math \u2013 htaccess\" alt=\"Rank Math \u2013 htaccess\" data-aspect-ratio=\"0.91142857142857\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/04\/rank-math-htaccess-1.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>Adding redirects directly to your .htaccess file (or indirectly via a plugin like Rank Math) often results in faster performance since it cuts out the middleman (the plugin). And once you know how to do it, it\u2019s not all that technical anyway.<\/p>\n<p>(It won\u2019t always be the best option from a performance perspective. But generally it\u2019s going to be faster.)<\/p>\n<p>Other platforms like Shopify and Wix don\u2019t give you direct access to .htaccess files. In these cases, you\u2019ll need to use the platform\u2019s built-in redirect tools instead.<\/p>\n<p>The same may be true for WordPress site owners if your site runs on <strong>WordPress.com<\/strong>, rather than external hosting with a <strong>WordPress.org<\/strong> installation.<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-further-reading.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Further reading:<\/strong> <a title=\"WordPress Redirects Made Easy: Plugin &amp; Code Methods\" href=\"https:\/\/backlinko.com\/wordpress-redirects\" target=\"_blank\" rel=\"noopener\">WordPress Redirects Made Easy: Plugin &amp; Code Methods<\/a><\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-further-reading.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Before_You_Begin_Important_Prerequisites\"><\/span>Before You Begin: Important Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Before you start making changes to your .htaccess file, bear the following in mind:<\/p>\n<ul>\n<li><strong>You need to have an .htaccess file:<\/strong> If you don\u2019t already have an .htaccess file, you can create one in your public_html folder (WordPress will often create one for you automatically).<\/li>\n<li><strong>It\u2019s easy to make mistakes:<\/strong> Making changes to your .htaccess file without knowing what you\u2019re doing can have major consequences for your site. Ideally consult with your developer before implementing .htaccess redirects, and make any major changes on a staging site if possible to make sure they work properly.<\/li>\n<li><strong>The rules below are just guides:<\/strong> I\u2019ve included lots of examples of redirect rules below with explanations of what they do. But you may need to modify them to ensure they work properly on your site.<\/li>\n<li><strong>Enable mod_rewrite:<\/strong> Most modern hosting environments will enable the mod_rewrite module by default (which you want, and therefore likely don\u2019t need to worry about). If your redirects aren\u2019t working, reach out to your hosting provider to see if this is the problem.<\/li>\n<li><strong>Enable Options + FollowSymLinks:<\/strong> You may or may not need to enable this in your .htaccess file (usually you won\u2019t need to worry about it). Again, reach out to your host if you\u2019re not sure.<\/li>\n<\/ul>\n<p>Now that you know how to actually get into and edit your .htaccess file, let\u2019s look at how to create different types of redirects.<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Free resource:<\/strong> Make your life even easier with our handy <a title=\"WordPress Redirects Cheat Sheet\" href=\"https:\/\/docs.google.com\/spreadsheets\/u\/0\/d\/1n9-naLQeQhAYxCAfU0vhd7RhpnN-AY5JnzczseQQfb4\/copy\" target=\"_blank\" rel=\"noopener\">.htaccess redirect cheat sheet<\/a>. Just add your domain or URLs to automatically generate rules you can copy and paste into your .htaccess file.<\/p>\n<\/blockquote>\n<div class=\"media\">\n                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/div>\n<\/div>\n<\/div>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Redirect_a_Single_URL\"><\/span>How to Redirect a Single URL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Redirecting a single URL to another is probably the most common redirect you\u2019ll create. It\u2019s perfect for when you\u2019ve:<\/p>\n<ul>\n<li>Changed a page\u2019s URL structure<\/li>\n<li>Merged two pages into one<\/li>\n<li>Moved specific content to a new location<\/li>\n<\/ul>\n<figure class=\"backlinko-image__visual-chart backlinko-image\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Merging two URLs\" alt=\"Merging two URLs\" data-aspect-ratio=\"0.62714285714286\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/07\/merging-two-urls.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>This type of redirect is straightforward and requires just one line of code in your .htaccess file.<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Note:<\/strong> As with all the redirects I\u2019ll discuss below, you need to make sure the new page is a live URL. Otherwise, the user or search engine will run into a 404 error as it\u2019s a <a title=\"How to Find (and Fix) Broken Links\" href=\"https:\/\/backlinko.com\/how-to-find-and-fix-broken-links\" target=\"_blank\" rel=\"noopener\">broken link<\/a>. While a powerful file, <strong>.htaccess doesn\u2019t automatically create the new pages for you<\/strong>.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Here\u2019s the code you\u2019ll need to add to your .htaccess file (swapping out the URL path and domain for your own):<\/p>\n<pre>Redirect 301 \/old-page https:\/\/yoursite.com\/new-page<\/pre>\n<p>Let\u2019s break down what this means:<\/p>\n<ul>\n<li><strong>Redirect:<\/strong> Tells the server you want to create a redirect<\/li>\n<li><strong>301:<\/strong> Specifies a permanent redirect (more on this below)<\/li>\n<li><strong>\/old-page:<\/strong> The path of the original page (relative to your root directory)<\/li>\n<li><strong>https:\/\/yoursite.com\/new-page:<\/strong> The full URL of the destination page<\/li>\n<\/ul>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Important:<\/strong> For the first part (old page), you only need the path without your domain name. For the second part (new page), you need the complete URL, <strong>including https:\/\/ and your domain<\/strong>.<\/p>\n<\/blockquote>\n<div class=\"media\">\n                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Single_URL_Redirect_Example\"><\/span>Single URL Redirect Example<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Let\u2019s say you have a page about dog training at:<\/p>\n<pre>https:\/\/yourpetsite.com\/5-great-tips-for-training-dogs\/<\/pre>\n<p>And you\u2019ve moved it to:<\/p>\n<pre>https:\/\/yourpetsite.com\/dog-training-tips\/<\/pre>\n<p>Your redirect code would look like this:<\/p>\n<pre>Redirect 301 \/5-great-tips-for-training-dogs\/ https:\/\/yourpetsite.com\/dog-training-tips\/<\/pre>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Note:<\/strong> No matter which type of .htaccess redirect you use, make sure you stay consistent with regard to your site\u2019s URL structure. Specifically, if you include a trailing slash at the end of your URLs (e.g., \/page-1\/), make sure you include that in your redirect rules. <\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Permanent_vs_Temporary_Redirects\"><\/span>Permanent vs. Temporary Redirects<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The 301 in our example above indicates a permanent redirect. This tells search engines to update their index with the new URL and transfer the SEO value from the old page to the new one.<\/p>\n<p>If you\u2019re only redirecting temporarily (like for maintenance or a seasonal promotion), use 302 instead:<\/p>\n<pre>Redirect 302 \/sale https:\/\/yoursite.com\/spring-sale<\/pre>\n<p>If you\u2019re trying to preserve SEO rankings (and your <a title=\"Free Website Authority Checker (Enter Any Domain or URL)\" href=\"https:\/\/backlinko.com\/tools\/website-authority\" target=\"_blank\" rel=\"noopener\">website\u2019s authority<\/a>), <strong>always use 301 redirects for permanent URL changes<\/strong>. Search engines treat 301s as permanent and 302s as temporary, which affects how they transfer link equity.<\/p>\n<figure class=\"backlinko-image__visual-chart backlinko-image\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"301 Redirect\" alt=\"301 Redirect\" data-aspect-ratio=\"0.62428571428571\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/04\/301-redirect.png\" loading=\"lazy\" \/><\/p><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Redirect_a_Subfolder\"><\/span>How to Redirect a Subfolder<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Sometimes you need to redirect an entire section of your website rather than just a single page. This is common when you are:<\/p>\n<ul>\n<li>Reorganizing your <a title=\"How to Setup an SEO-Friendly Website Architecture\" href=\"https:\/\/backlinko.com\/hub\/seo\/architecture\" target=\"_blank\" rel=\"noopener\">site structure<\/a><\/li>\n<li>Moving a blog or product category to a new location<\/li>\n<li>Consolidating content from multiple sections<\/li>\n<\/ul>\n<p>Redirecting a subfolder automatically handles all pages within that folder. So you don\u2019t need to set up individual redirect rules for each one.<\/p>\n<p>Here\u2019s the code to add to your .htaccess file:<\/p>\n<pre>RewriteEngine On\r\n\r\nRewriteRule ^old-folder\/(.*)$ \/new-folder\/$1 [R=301,L]<\/pre>\n<p>Let\u2019s break down the key parts:<\/p>\n<ul>\n<li><strong>RewriteEngine On:<\/strong> Activates Apache\u2019s rewrite module (required for this type of redirect*)<\/li>\n<li><strong>^old-folder\/:<\/strong> Matches the beginning of URLs that start with your old folder<\/li>\n<li><strong>(.*)$:<\/strong> Captures everything after the folder name<\/li>\n<li><strong>\/new-folder\/$1:<\/strong> Sends visitors to the new folder, maintaining the rest of the URL path<\/li>\n<li><strong>[R=301,L]:<\/strong> Specifies a permanent redirect and tells the server to stop processing rules after this match<\/li>\n<\/ul>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p>You don\u2019t need to know what this means. But it\u2019s an important line to include for some .htaccess redirect rules. You only need to include it once (unless you also have \u201cRewriteEngine Off\u201d in your file before a given rule). <\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Subfolder_Redirect_Example\"><\/span>Subfolder Redirect Example<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Let\u2019s say you have a blog at:<\/p>\n<pre>https:\/\/yoursite.com\/blog\/post-name<\/pre>\n<p>And you want to move it to:<\/p>\n<pre>https:\/\/yoursite.com\/articles\/post-name<\/pre>\n<p>Your redirect code would look like this:<\/p>\n<pre>RewriteEngine On\r\nRewriteRule ^blog\/(.*)$ \/articles\/$1  [R=301,L ]<\/pre>\n<p>This will redirect:<\/p>\n<ul>\n<li>\/blog\/first-post to \/articles\/first-post<\/li>\n<li>\/blog\/category\/tech to \/articles\/category\/tech<\/li>\n<li>Any other path that starts with \/blog\/ to the relevant \/articles\/ path<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Important_Order_Matters\"><\/span>Important: Order Matters<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The order of your .htaccess rules matters. This isn\u2019t going to be an issue if you\u2019re just redirecting a single URL.<\/p>\n<p>But if you want to redirect some parts of a subfolder to one place and others elsewhere, you need to be careful.<\/p>\n<p>Let\u2019s look at an example to make this clearer:<\/p>\n<p>Imagine you have a blog subfolder with a special <strong>\/featured\/<\/strong> section. You want to redirect your <strong>\/blog\/<\/strong> content to an <strong>\/articles\/<\/strong> subfolder, but the featured posts should go to <strong>\/featured-content\/<\/strong>.<\/p>\n<p>Here\u2019s the <strong>WRONG<\/strong> order:<\/p>\n<pre>RewriteEngine On\r\nRewriteRule ^blog\/(.*)$ \/articles\/$1 [R=301,L]\r\nRewriteRule ^blog\/featured\/(.*)$ \/featured-content\/$1 [R=301,L]<\/pre>\n<p>Why is this incorrect?<\/p>\n<p>Because any time a user (or Google) requests a URL on your site (say, your site.com\/blog\/featured\/your-post\/), Apache first checks if it matches the \/blog\/ structure.<\/p>\n<p>In this case, it does. So it would redirect:<\/p>\n<pre>yoursite.com\/blog\/featured\/your-post\/<\/pre>\n<p>To:<\/p>\n<pre>yoursite.com\/articles\/your-post\/<\/pre>\n<p>The URL no longer matches the \/blog\/featured\/ structure, so the second rule would never apply to it. Meaning all your featured posts would just redirect to the new \/articles\/ subfolder.<\/p>\n<p>Here\u2019s the correct order:<\/p>\n<pre>RewriteEngine On\r\nRewriteRule ^blog\/featured\/(.*)$ \/featured-content\/$1 [R=301,L] \r\nRewriteRule ^blog\/(.*)$ \/articles\/$1 [R=301,L]<\/pre>\n<p>This first checks for the \/blog\/featured\/ structure and redirects it to the new \/featured-content\/. So your post at:<\/p>\n<pre>yoursite.com\/blog\/featured\/your-post\/<\/pre>\n<p>Would redirect to:<\/p>\n<pre>yoursite.com\/featured-content\/your-post\/<\/pre>\n<p>And then in this case it no longer matches the \/blog\/ structure, so the second rule wouldn\u2019t apply. Which is what we want.<\/p>\n<p>For any non-featured blog URLs, like <strong>yoursite.com\/blog\/post-2\/<\/strong>, they\u2019d redirect per the second rule to <strong>yoursite.com\/articles\/post-2\/<\/strong> (because the first rule wouldn\u2019t apply to them without the \/featured\/ part of the URL).<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Redirecting_a_Subfolder_to_a_Different_Domain\"><\/span>Redirecting a Subfolder to a Different Domain<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Before I show you how to redirect your entire site to a new domain, it\u2019s worth noting that you can also redirect a subfolder to a completely different domain. This is useful if you\u2019ve moved a section of your site to a new website.<\/p>\n<p>Here\u2019s the rule to use:<\/p>\n<pre>RewriteEngine On\r\nRewriteRule ^old-folder\/(.*)$ https:\/\/newdomain.com\/folder\/$1 [R=301,L]<\/pre>\n<p>For example, you could use this if you moved your support section to a dedicated support site:<\/p>\n<pre>RewriteEngine On\r\nRewriteRule ^support\/(.*)$ https:\/\/support.yourcompany.com\/$1 [R=301,L]<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Redirect_to_a_New_Domain\"><\/span>How to Redirect to a New Domain<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Moving to a new domain is a big step. Whether you\u2019re rebranding, switching from a .org to a .com domain, or consolidating multiple websites, you need to make sure your visitors (and search engines) can find your new site.<\/p>\n<p>A domain-wide redirect ensures anyone visiting your old domain automatically lands on your new one. This preserves both the user experience and authority you\u2019ve built up through <a title=\"What Are Backlinks in SEO? &amp; Why You Need Them\" href=\"https:\/\/backlinko.com\/hub\/seo\/backlinks\" target=\"_blank\" rel=\"noopener\">backlinks<\/a>.<\/p>\n<p>Here\u2019s the code to add to your .htaccess file on your old domain:<\/p>\n<pre>RewriteEngine On\r\nRewriteCond %{HTTP_HOST} ^(www.)?olddomain.com$ [NC]\r\nRewriteRule ^(.*)$ https:\/\/newdomain.com\/$1 [L,R=301]<\/pre>\n<p>Let\u2019s break down what this does:<\/p>\n<ul>\n<li><strong>RewriteEngine On:<\/strong> Activates the rewrite module<\/li>\n<li><strong>RewriteCond %{HTTP_HOST} ^(www.)?olddomain.com$ [NC]<\/strong>: Checks if someone is trying to access your old domain, where:\n<ul>\n<li><strong>^(www.)?:<\/strong> Matches both www and non-www versions of your site<\/li>\n<li><strong>[NC]:<\/strong> Makes the match not case-sensitive (so OLDDOMAIN.com would also match)<\/li>\n<\/ul>\n<\/li>\n<li><strong>RewriteRule ^(.*)$ https:\/\/newdomain.com\/$1 [L,R=301]<\/strong>: Sets up a permanent redirect to the new domain, where:\n<ul>\n<li><strong>^(.*)$:<\/strong> Captures the entire URL path after the domain<\/li>\n<li><strong>https:\/\/newdomain.com\/$1:<\/strong> Redirects to the same path on your new domain<\/li>\n<li><strong>[L,R=301]:<\/strong> Makes it a permanent redirect and stops processing other rules for that request<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/03\/icon-remember-v2.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Remember:<\/strong> If you already have <strong>RewriteEngine On<\/strong> elsewhere in your .htaccess file (and you don\u2019t also have <strong>RewriteEngine Off<\/strong>), you don\u2019t need to add it again.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/03\/icon-remember-v2.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Domain_Redirect_Example\"><\/span>Domain Redirect Example<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Let\u2019s say you\u2019re changing from:<\/p>\n<pre>https:\/\/pettraining.com\/dog-care\/grooming<\/pre>\n<p>To:<\/p>\n<pre>https:\/\/pawacademy.com\/dog-care\/grooming<\/pre>\n<p>The redirect will automatically maintain the same path structure. This means visitors to any page on your old domain will land on the corresponding page on your new domain. (You\u2019ll obviously need to have corresponding URLs on the new domain.)<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/03\/icon-remember-v2.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Important:<\/strong> You need to place this .htaccess rule on your old domain\u2019s server, not the new one.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/03\/icon-remember-v2.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Domain migrations require careful planning. But when you do it properly, they can transfer most of your SEO value and ensure your audience can find your new online home. For more on how to do it right, check out our <a title=\"Website Migration Checklist: Essential SEO Steps for Success\" href=\"https:\/\/backlinko.com\/website-migration-checklist\" target=\"_blank\" rel=\"noopener\">website migration checklist<\/a>.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Redirect_www_to_Non-www_or_Vice_Versa_on_New_Domain\"><\/span>Redirect www to Non-www (or Vice Versa) on New Domain<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you\u2019re also changing from www to non-www (or vice versa) during your domain migration, you can combine these redirects:<\/p>\n<pre>RewriteEngine On\r\n\r\n# First redirect old domain to new domain\r\nRewriteCond %{HTTP_HOST} ^(www.)?olddomain.com$ [NC]\r\nRewriteRule ^(.*)$ https:\/\/newdomain.com\/$1 [L,R=301]\r\n\r\n# Then handle www to non-www on new domain\r\nRewriteCond %{HTTP_HOST} ^www.newdomain.com$ [NC]\r\nRewriteRule ^(.*)$ https:\/\/newdomain.com\/$1 [L,R=301]<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Redirect_HTTP_to_HTTPS\"><\/span>How to Redirect HTTP to HTTPS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Redirecting from HTTP to HTTPS isn\u2019t just a good practice \u2014 it\u2019s practically mandatory. HTTPS encrypts the connection between your visitors and your website. This protects sensitive information, while also being a light Google ranking factor.<\/p>\n<p>(I\u2019m not suggesting you redirect to HTTPS for a ranking boost. It really is just the default best practice nowadays more than anything else.)<\/p>\n<figure class=\"backlinko-image__visual-chart backlinko-image\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"HTTP redirect\" alt=\"HTTP redirect\" data-aspect-ratio=\"0.18857142857143\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/07\/http-redirect.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>If you\u2019ve installed an SSL certificate but visitors can still access your site through unencrypted HTTP, you\u2019ll want to set up a redirect to ensure everyone gets the secure version.<\/p>\n<p>Here\u2019s the code to add to your .htaccess file:<\/p>\n<pre>RewriteEngine On\r\nRewriteCond %{HTTPS} off\r\nRewriteRule ^(.*)$ https:\/\/%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\r\n<\/pre>\n<p>This is what each part does:<\/p>\n<ul>\n<li><strong>RewriteEngine On:<\/strong> Activates the rewrite module<\/li>\n<li><strong>RewriteCond %{HTTPS} off:<\/strong> Checks if the connection is currently not using HTTPS<\/li>\n<li><strong>^(.*)$:<\/strong> captures the entire URL path<\/li>\n<li><strong>https:\/\/%{HTTP_HOST}%{REQUEST_URI}:<\/strong> Redirects to the same URL but with https:\/\/ instead of http:\/\/<\/li>\n<li><strong>[L,R=301]:<\/strong> Makes it a permanent redirect and stops processing other rules<\/li>\n<\/ul>\n<p>This redirect will change:<\/p>\n<pre>http:\/\/yourwebsite.com\/products\/item<\/pre>\n<p>To:<\/p>\n<pre>https:\/\/yourwebsite.com\/products\/item<\/pre>\n<p>The redirect preserves the entire <a title=\"How to Create SEO-Friendly URLs\" href=\"https:\/\/backlinko.com\/hub\/seo\/urls\" target=\"_blank\" rel=\"noopener\">URL structure<\/a> \u2014 only the protocol changes from HTTP to HTTPS.<\/p>\n<p>Unlike other redirects, you don\u2019t need to customize this code with your domain name. The %{HTTP_HOST} variable automatically uses whatever domain the visitor is trying to access.<\/p>\n<p>In other words: you can just copy and paste this in as is.<\/p>\n<p><strong>BUT:<\/strong><\/p>\n<p>Before adding this redirect, make sure:<\/p>\n<ul>\n<li>You have a valid SSL certificate installed on your server<\/li>\n<li>All site resources (images, scripts, etc.) are accessible via HTTPS<\/li>\n<li>Your site functions properly when accessed via HTTPS<\/li>\n<li>Your SSL certificate covers all subdomains if you\u2019re redirecting them to HTTPS as well<\/li>\n<\/ul>\n<p>And most importantly: <strong>make sure you don\u2019t already have a method in place to force HTTPS<\/strong>, as this can cause redirect loops and other potential performance issues.<\/p>\n<p>While .htaccess is one way to implement HTTPS redirects, you may have other options (perhaps ones that are already doing this for you):<\/p>\n<ul>\n<li><strong>Hosting control panel:<\/strong> Many hosting providers offer one-click HTTPS enforcement through their control panel (maybe even doing it by default)<\/li>\n<li><strong>WordPress settings:<\/strong> If you\u2019re using WordPress, check the \u201cWordPress Address\u201d and \u201cSite Address\u201d settings under Settings &gt; General (both should start with https:\/\/)<\/li>\n<li><strong>Plugin solutions:<\/strong> WordPress plugins like Really Simple SSL can handle the redirect for you<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Redirect_WWW_to_Non-WWW\"><\/span>How to Redirect WWW to Non-WWW<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Should your website be <strong>www.yoursite.com<\/strong> or just <strong>yoursite.com<\/strong>? This seemingly small detail actually matters a lot for consistency, user experience, and SEO.<\/p>\n<p>Having both versions accessible can create <a title=\"Duplicate Content and SEO: The Complete Guide\" href=\"https:\/\/backlinko.com\/hub\/seo\/duplicate-content\" target=\"_blank\" rel=\"noopener\">duplicate content issues<\/a>. So you should pick one format and redirect the other to it.<\/p>\n<p>In most cases, there\u2019s no definitive technical advantage to either format.<\/p>\n<p>But non-WWW is shorter, cleaner, and easier to say in conversation.<\/p>\n<p>Most modern websites lean toward the non-www version, but either choice is fine as long as you\u2019re consistent.<\/p>\n<p>Let\u2019s look at how to redirect the www version to the non-www version (then I\u2019ll show you how to reverse this if you prefer www).<\/p>\n<p>Here\u2019s the code to add to your .htaccess file:<\/p>\n<pre>RewriteEngine On\r\n\r\nRewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]\r\n\r\nRewriteRule ^(.*)$ https:\/\/%1\/$1 [L,R=301]<\/pre>\n<p>Breaking this down:<\/p>\n<ul>\n<li><strong>RewriteEngine On:<\/strong> Activates the rewrite module<\/li>\n<li><strong>RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]:<\/strong> Checks if the URL starts with \u201cwww\u201d where:\n<ul>\n<li><strong>(.*)$:<\/strong> Captures the domain name without the www<\/li>\n<li><strong>^(.*)$:<\/strong> Captures the entire path after the domain<\/li>\n<\/ul>\n<\/li>\n<li><strong>https:\/\/%1\/$1:<\/strong> Redirects to the same URL without www where:\n<ul>\n<li><strong>%1:<\/strong> Refers to the domain captured in the RewriteCond<\/li>\n<li><strong>$1:<\/strong> Refers to the page path<\/li>\n<\/ul>\n<\/li>\n<li><strong>[L,R=301]:<\/strong> Makes it a permanent redirect and stops processing other rules<\/li>\n<\/ul>\n<p>This redirect will change:<\/p>\n<pre>https:\/\/www.yourbusiness.com\/about-us<\/pre>\n<p>To:<\/p>\n<pre>https:\/\/yourbusiness.com\/about-us<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"What_About_Non-WWW_to_WWW\"><\/span>What About Non-WWW to WWW?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you prefer the www version instead, simply reverse the logic (you need an extra RewriteCond line as well):<\/p>\n<pre>RewriteEngine On\r\n\r\nRewriteCond %{HTTP_HOST} !^www. [NC]\r\n\r\nRewriteCond %{HTTP_HOST} ^(.*)$ [NC]\r\n\r\nRewriteRule ^(.*)$ https:\/\/www.%1\/$1 [L,R=301]<\/pre>\n<p>This checks if the URL does NOT start with www and then adds it.<\/p>\n<p>This is another rule you can simply copy and paste into your .htaccess file. But as with HTTP redirects, you need to make sure you\u2019re not already redirecting via another method. Otherwise you might run into redirect loops and other issues.<\/p>\n<p>Outside of your .htaccess file, you can force www\/non-www via:<\/p>\n<ul>\n<li><strong>DNS settings:<\/strong> Some DNS providers let you set a preferred version when configuring your domain<\/li>\n<li><strong>Hosting control panel:<\/strong> Many hosts offer settings to enforce www or non-www<\/li>\n<li><strong>WordPress settings:<\/strong> In WordPress, check the \u201cWordPress Address\u201d and \u201cSite Address\u201d fields under Settings &gt; General (both should use your preferred format)<\/li>\n<\/ul>\n<p>Make sure to test all versions of your domain to ensure they all lead to your preferred version:<\/p>\n<ul>\n<li>http:\/\/yoursite.com<\/li>\n<li>http:\/\/www.yoursite.com<\/li>\n<li>https:\/\/yoursite.com<\/li>\n<li>https:\/\/www.yoursite.com<\/li>\n<\/ul>\n<p>All four should ultimately end up at the same place (ideally https:\/\/yoursite.com if you\u2019re going with non-www, or https:\/\/www.yoursite.com if you prefer www).<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Other_Types_of_htaccess_Redirect\"><\/span>Other Types of .htaccess Redirect<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>While the above covers the most common .htaccess redirect scenarios, the file is incredibly versatile and can handle many other specialized redirect situations.<\/p>\n<p>Let\u2019s explore some other redirect types that might come in handy for specific use cases.<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Note:<\/strong> As with any .htaccess rules, it\u2019s easy to make small mistakes here that can have big consequences, and you may need to modify the examples below to work with your specific situation. So consult your developer if possible. <\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Redirect_Based_on_Query_Parameters\"><\/span>Redirect Based on Query Parameters<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Sometimes you need to redirect based on what appears after the question mark in a URL. These are <a title=\"URL Parameters: What They Are and How to Use Them Properly\" href=\"https:\/\/backlinko.com\/url-parameters\" target=\"_blank\" rel=\"noopener\">URL parameters<\/a>, and they\u2019re useful for tracking and organizing site content.<\/p>\n<p>Here\u2019s an example .htaccess redirect rule for managing URL parameters (also known as query strings):<\/p>\n<pre>RewriteEngine On\r\n\r\nRewriteCond %{QUERY_STRING} ^product=widget$\r\n\r\nRewriteRule ^products.php$ \/widgets\/? [L,R=301]<\/pre>\n<p>This redirects \/products.php?product=widget to \/widgets\/ while removing the query string.<\/p>\n<p>The question mark at the end of the destination URL tells the server to strip the original query parameters rather than passing them along.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Redirect_to_a_Specific_Port\"><\/span>Redirect to a Specific Port<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you need to redirect to a different port (like for a development environment), use this rule:<\/p>\n<pre>RewriteEngine On\r\n\r\nRewriteRule ^dev\/(.*)$ http:\/\/localhost:8080\/$1 [L,R=301]<\/pre>\n<p>This would redirect requests for \/dev\/page to http:\/\/localhost:8080\/page.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Custom_Error_Page_Redirects\"><\/span>Custom Error Page Redirects<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You can set up custom pages for various HTTP error codes.<\/p>\n<p>For example, you can send users and search engines to dedicated error pages:<\/p>\n<pre>ErrorDocument 404 \/custom-404\r\n\r\nErrorDocument 500 \/server-error<\/pre>\n<p>While these aren\u2019t technically redirects (they\u2019re error handlers), they help provide a better user experience when things go wrong.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Temporary_vs_Permanent_Redirects\"><\/span>Temporary vs. Permanent Redirects<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>We\u2019ve mostly covered 301 (permanent) redirects, but 302 (temporary) redirects are useful for:<\/p>\n<ul>\n<li>Maintenance pages<\/li>\n<li>Seasonal promotions<\/li>\n<li>A\/B testing<\/li>\n<\/ul>\n<p>To create a temporary redirect, simply change the 301 to 302:<\/p>\n<pre>Redirect 302 \/sale \/summer-sale<\/pre>\n<p>When using temporary redirects for maintenance, you can create a rule that excludes your IP address so you can still access the original page:<\/p>\n<pre>RewriteEngine On\r\n\r\nRewriteCond %{REMOTE_ADDR} !^123.456.789.0\r\n\r\nRewriteRule ^(.*)$ \/maintenance [R=302,L]<\/pre>\n<p>Where 123.456.789.0 is your IP address.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Redirecting_Specific_File_Types\"><\/span>Redirecting Specific File Types<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>You can also redirect requests for specific file types, like PDFs:<\/p>\n<pre>RewriteEngine On\r\n\r\nRewriteRule ^(.*).pdf$ \/documents\/$1.pdf [L,R=301]<\/pre>\n<p>This moves all PDF files to a \/documents\/ folder.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Redirect_to_Force_Trailing_Slash\"><\/span>Redirect to Force Trailing Slash<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>For consistency, you might want all URLs to either have or not have a trailing slash:<\/p>\n<pre>RewriteEngine On\r\n\r\nRewriteCond %{REQUEST_FILENAME} !-f\r\n\r\nRewriteRule ^(.*[^])$ \/$1\/ [L,R=301]<\/pre>\n<p>This adds a trailing slash to all URLs that don\u2019t represent actual files.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Htaccess_Redirects_Symbols_Explained_Cheat_Sheet\"><\/span>Htaccess Redirects Symbols Explained (+ Cheat Sheet)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The symbols in .htaccess redirects can look cryptic at first glance. Those carets, dollar signs, and brackets serve important purposes that aren\u2019t immediately obvious.<\/p>\n<p>Rather than trying to learn what they all do, below is a handy reference you can return to whenever you need to create or modify your redirects.<\/p>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Free resource:<\/strong> <a title=\".htaccess Redirect Symbols Cheat Sheet\" href=\"https:\/\/docs.google.com\/document\/d\/1WV9lPhkZb74ytE4ukGS1Ps0mIt-0j5g5HLccARwOaxQ\/copy\" target=\"_blank\" rel=\"noopener\">Download this cheat sheet here<\/a>.<\/p>\n<\/blockquote>\n<div class=\"media\">\n                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/div>\n<\/div>\n<\/div>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Common_htaccess_Symbols\"><\/span>Common .htaccess Symbols<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"table-responsive\">\n<table class=\"table table-primary table-striped table-hover\">\n<tbody>\n<tr>\n<th scope=\"col\">Symbol<\/th>\n<th scope=\"col\">Name<\/th>\n<th scope=\"col\">What It Does<\/th>\n<th scope=\"col\">Example<\/th>\n<\/tr>\n<\/tbody>\n<tbody>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\">^<\/td>\n<td data-before=\"Name\">Caret<\/td>\n<td data-before=\"What It Does\">Matches the beginning of a string<\/td>\n<td data-before=\"Example\">^blog matches URLs that start with \u201cblog\u201d<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\">$<\/td>\n<td data-before=\"Name\">Dollar sign<\/td>\n<td data-before=\"What It Does\">Matches the end of a string<\/td>\n<td data-before=\"Example\">.html$ matches URLs that end with \u201c.html\u201d<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\">()<\/td>\n<td data-before=\"Name\">Parentheses<\/td>\n<td data-before=\"What It Does\">Groups patterns and captures matched content<\/td>\n<td data-before=\"Example\">(.*?) captures content to be used later<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\">$1, $2\u2026<\/td>\n<td data-before=\"Name\">Dollar sign with number<\/td>\n<td data-before=\"What It Does\">References captured groups in RewriteRule<\/td>\n<td data-before=\"Example\">\/$1.html inserts the first captured group<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\">%1, %2\u2026<\/td>\n<td data-before=\"Name\">Percent with number<\/td>\n<td data-before=\"What It Does\">References captured groups in RewriteCond<\/td>\n<td data-before=\"Example\">https:\/\/%1 uses the domain captured in a condition<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\">.<\/td>\n<td data-before=\"Name\">Period<\/td>\n<td data-before=\"What It Does\">Matches any single character<\/td>\n<td data-before=\"Example\">a.c matches \u201cabc\u201d, \u201cadc\u201d, etc.<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\">*<\/td>\n<td data-before=\"Name\">Asterisk<\/td>\n<td data-before=\"What It Does\">Matches zero or more of the preceding character<\/td>\n<td data-before=\"Example\">a* matches \u201c\u201d, \u201ca\u201d, \u201caa\u201d, \u201caaa\u201d, etc.<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\">+<\/td>\n<td data-before=\"Name\">Plus<\/td>\n<td data-before=\"What It Does\">Matches one or more of the preceding character<\/td>\n<td data-before=\"Example\">a+ matches \u201ca\u201d, \u201caa\u201d, \u201caaa\u201d, etc. (but not \u201c\u201d)<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\">?<\/td>\n<td data-before=\"Name\">Question mark<\/td>\n<td data-before=\"What It Does\">Makes the preceding character optional<\/td>\n<td data-before=\"Example\">colou?r matches both \u201ccolor\u201d and \u201ccolour\u201d<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\">[<\/td>\n<td data-before=\"Name\">Square brackets<\/td>\n<td data-before=\"What It Does\">Contains flags or defines a character set<\/td>\n<td data-before=\"Example\">[L,R=301] sets flags; [a-z] matches lowercase letters<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\"><\/td>\n<td data-before=\"Name\">Backslash<\/td>\n<td data-before=\"What It Does\">Escapes special characters<\/td>\n<td data-before=\"Example\">. matches a literal period rather than any character<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Symbol\">|<\/td>\n<td data-before=\"Name\">Pipe<\/td>\n<td data-before=\"What It Does\">Acts as OR operator<\/td>\n<td data-before=\"Example\">cat|dog matches \u201ccat\u201d or \u201cdog\u201d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Flag_Options\"><\/span>Flag Options<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"table-responsive\">\n<table class=\"table table-primary table-striped table-hover\">\n<thead>\n<tr>\n<th scope=\"col\">Flag<\/th>\n<th scope=\"col\">Full Name<\/th>\n<th scope=\"col\">Purpose<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td scope=\"row\" data-before=\"Flag\">L<\/td>\n<td data-before=\"Full Name\">Last<\/td>\n<td data-before=\"Purpose\">Stops processing rules if this one matches<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Flag\">R=301<\/td>\n<td data-before=\"Full Name\">Redirect (301)<\/td>\n<td data-before=\"Purpose\">Creates a permanent redirect<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Flag\">R=302<\/td>\n<td data-before=\"Full Name\">Redirect (302)<\/td>\n<td data-before=\"Purpose\">Creates a temporary redirect<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Flag\">NC<\/td>\n<td data-before=\"Full Name\">No Case<\/td>\n<td data-before=\"Purpose\">Makes the match case-insensitive<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Flag\">QSA<\/td>\n<td data-before=\"Full Name\">Query String Append<\/td>\n<td data-before=\"Purpose\">Adds query parameters from the original URL<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Flag\">F<\/td>\n<td data-before=\"Full Name\">Forbidden<\/td>\n<td data-before=\"Purpose\">Returns a 403 Forbidden status<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Flag\">G<\/td>\n<td data-before=\"Full Name\">Gone<\/td>\n<td data-before=\"Purpose\">Returns a 410 Gone status (resource permanently removed)<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Flag\">PT<\/td>\n<td data-before=\"Full Name\">Pass Through<\/td>\n<td data-before=\"Purpose\">Passes the request to other modules for further processing<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"RewriteCond_Variables\"><\/span>RewriteCond Variables<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div class=\"table-responsive\">\n<table class=\"table table-primary table-striped table-hover\">\n<thead>\n<tr>\n<th scope=\"col\">Variable<\/th>\n<th scope=\"col\">What It Contains<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td scope=\"row\" data-before=\"Variable\">%{HTTP_HOST}<\/td>\n<td data-before=\"What It Contains\">Domain name from the request (e.g., example.com)<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Variable\">%{REQUEST_URI}<\/td>\n<td data-before=\"What It Contains\">The path part of the URL (e.g., \/folder\/page\/)<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Variable\">%{QUERY_STRING}<\/td>\n<td data-before=\"What It Contains\">Everything after the ? in a URL<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Variable\">%{REQUEST_FILENAME}<\/td>\n<td data-before=\"What It Contains\">The full path to the requested file<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Variable\">%{HTTP_USER_AGENT}<\/td>\n<td data-before=\"What It Contains\">Information about the visitor\u2019s browser<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Variable\">%{HTTPS}<\/td>\n<td data-before=\"What It Contains\">\u201con\u201d if the connection is secure, \u201coff\u201d otherwise<\/td>\n<\/tr>\n<tr>\n<td scope=\"row\" data-before=\"Variable\">%{REMOTE_ADDR}<\/td>\n<td data-before=\"What It Contains\">The visitor\u2019s IP address<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3><span class=\"ez-toc-section\" id=\"Pattern_Matching_Examples\"><\/span>Pattern Matching Examples<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Here are a few examples of the kinds of rules you can set up once you get the hang of all the symbols, flags, and variables:<\/p>\n<h4><span class=\"ez-toc-section\" id=\"URL_Paths\"><\/span>URL Paths<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li><strong>^about$<\/strong> matches ONLY the exact URL \u201c\/about\u201d (not \u201c\/about-us\u201d or \u201c\/about\/team\u201d)<\/li>\n<li><strong>^about(.*)<\/strong> matches \u201c\/about\u201d plus anything after it (\u201c\/about-us\u201d, \u201c\/about\/team\u201d, etc.)<\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"File_Types\"><\/span>File Types<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li><strong>.(pdf|docx|xlsx)$<\/strong> matches URLs ending in .pdf, .docx, or .xlsx (for specific file handling)<\/li>\n<li><strong>^((?!.html).)*$<\/strong> matches any URL that does NOT end with .html (for handling non-HTML requests)<\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"Flag_Variations\"><\/span>Flag Variations<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li><strong>RewriteRule ^blog\/(.*)$ \/articles\/$1 [R=301,L]<\/strong> creates a permanent (301) redirect that browsers and search engines will cache<\/li>\n<li><strong>RewriteRule ^blog\/(.*)$ \/articles\/$1 [R=302,L]<\/strong> creates a temporary (302) redirect that won\u2019t be permanently cached by browsers (useful during site testing)<\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"Variable_Conditions\"><\/span>Variable Conditions<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li><strong>RewriteCond %{HTTP_HOST} example.com<\/strong> matches requests specifically to example.com (case-sensitive, excludes www.example.com)<\/li>\n<li><strong>RewriteCond %{REQUEST_URI} ^\/blog\/articles<\/strong> matches URLs with path exactly \u201c\/blog\/articles\u201d (this is case-sensitive on many servers)<\/li>\n<\/ul>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-tip.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Pro tip:<\/strong> When creating complex patterns, build them incrementally and test each step. It\u2019s easier to debug a simple pattern than a complex one.<\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-tip.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<h2><span class=\"ez-toc-section\" id=\"How_to_Check_Your_Redirects_Are_Working\"><\/span>How to Check Your Redirects Are Working<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You\u2019ve done the hard work, so let\u2019s now find out how to make sure you\u2019ve set it all up correctly.<\/p>\n<p>Below are a few ways to check your redirects. The best one depends on the nature of your redirects and how many you\u2019ve set up.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Manual_Testing\"><\/span>Manual Testing<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The simplest way to test your redirects is to manually check them in your browser.<\/p>\n<p>Just enter the old URL you\u2019ve redirected and watch the address bar to see if it changes to the new URL.<\/p>\n<p>For a more detailed view of what\u2019s happening, use your browser\u2019s developer tools:<\/p>\n<ol>\n<li>Open developer tools (F12 in most browsers, or right click then \u201c<strong>Inspect<\/strong>\u201d) on the redirected page<\/li>\n<li>Go to the \u201c<strong>Network<\/strong>\u201d tab<\/li>\n<li>Reload the page and look for the redirect chain and status codes<\/li>\n<\/ol>\n<p>In the example below, you can see it has redirected from the URL \/position to \/positioning:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Backlinko Hub \u2013 Positioning \u2013 Redirect\" alt=\"Backlinko Hub \u2013 Positioning \u2013 Redirect\" data-aspect-ratio=\"0.67714285714286\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/04\/backlinko-hub-positioning-redirect.png\" loading=\"lazy\" \/><\/p><\/figure>\n<h3><span class=\"ez-toc-section\" id=\"Online_Redirect_Checkers\"><\/span>Online Redirect Checkers<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Several free tools can test your redirects and provide more technical details. One example is <a title=\"HTTP Status Code Checker\" href=\"https:\/\/httpstatus.io\/\" target=\"_blank\" rel=\"noopener\">HTTP Status Code Checker<\/a>.<\/p>\n<p>These tools show you the entire redirect path, status codes, and how long each redirect takes to process:<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"HTTP Status \u2013 URL status check\" alt=\"HTTP Status \u2013 URL status check\" data-aspect-ratio=\"0.84\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/07\/httpstatus-url-status-check.png\" loading=\"lazy\" \/><\/p><\/figure>\n<h3><span class=\"ez-toc-section\" id=\"Testing_Multiple_URLs\"><\/span>Testing Multiple URLs<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>If you\u2019ve set up many redirects (like a subfolder or domain-wide redirect), testing every URL manually isn\u2019t practical.<\/p>\n<p>The HTTP Status Code Checker tool does let you test multiple URLs\u2026<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Httpstatus \u2013 Homepage\" alt=\"Httpstatus \u2013 Homepage\" data-aspect-ratio=\"0.69\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/04\/httpstatus-homepage.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>But this won\u2019t be suitable for entire site redirects or when you have hundreds (or thousands) of redirects set up.<\/p>\n<p>You could use a crawling tool and compare the crawl results to your sitemap, but that\u2019s still going to be quite tedious.<\/p>\n<p>Instead, consider using a tool like Semrush\u2019s <a title=\"Site Audit: Improve the SEO of Your Website | Semrush\" href=\"https:\/\/www.semrush.com\/siteaudit\/\" target=\"_blank\" rel=\"noopener\">Site Audit<\/a>.<\/p>\n<p>Just pop your domain in, let the audit run, and then go to the \u201c<strong>Issues<\/strong>\u201d tab. Type in \u201credirect\u201d to flag relevant issues.<\/p>\n<figure class=\"backlinko-image__screenshot backlinko-image backlinko-has-border\">\n<div class=\"backlinko-img-placeholder\"><\/div>\n<p><img decoding=\"async\" title=\"Site Audit \u2013 Backlinko \u2013 Issues \u2013 Redirect\" alt=\"Site Audit \u2013 Backlinko \u2013 Issues \u2013 Redirect\" data-aspect-ratio=\"0.74714285714286\" src=\"https:\/\/backlinko.com\/app\/uploads\/2025\/04\/site-audit-backlinko-issues-redirect.png\" loading=\"lazy\" \/><\/p><\/figure>\n<p>In particular, look out for:<\/p>\n<ul>\n<li><strong># incorrect pages found in sitemap.xml:<\/strong> This will highlight any of your pages in your sitemap that are redirecting elsewhere<\/li>\n<li><strong># pages have a WWW resolve issue:<\/strong> This will highlight issues if you haven\u2019t specified which version (www or non-www) you prefer (e.g., via .htaccess redirects)<\/li>\n<li><strong>No redirect or canonical to HTTPS homepage from HTTP version:<\/strong> This checks if your homepage is set up to serve the secure HTTPS version<\/li>\n<li><strong># redirect chains and loops:<\/strong> These create a bad user experience and can impact your SEO<\/li>\n<li><strong># URLs with a temporary redirect:<\/strong> Double check these redirects are indeed meant to be temporary<\/li>\n<li><strong># URLs with a permanent redirect:<\/strong> Check these URLs are supposed to redirect, and make sure they redirect to the correct place<\/li>\n<\/ul>\n<div class=\"sc-quote alert blue-box font-georgia type-normal transparent-img-bg\">\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-sm-down\">\n            <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">        <\/figure>\n<div class=\"media-body\">\n<blockquote class=\"sc-quote\">\n<p><strong>Note:<\/strong> You can audit your site for free for up to 100 URLs. But for crawling more than that, <a title=\"Backlinko &amp; Semrush: 14-day PRO Trial\" href=\"https:\/\/www.semrush.com\/lp\/backlinko-offer\/en\/\" target=\"_blank\" rel=\"noopener\">try a Pro plan for free for 14 days with this link.<\/a><\/p>\n<\/blockquote>\n<div class=\"media\">\n<figure class=\"sc-picture media-left hidden-md-up\">\n                    <img decoding=\"async\" src=\"https:\/\/backlinko.com\/app\/uploads\/2024\/06\/icon-note.png\" alt=\"| Craig Hordlow\" loading=\"lazy\" title=\"| Craig Hordlow\">                <\/figure>\n<p>                                <cite class=\"sc-name media-body media-middle\"><br \/>\n                                    <\/cite>\n            <\/p><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>The post <a href=\"https:\/\/backlinko.com\/htaccess-redirect\" target=\"_blank\" rel=\"noopener\">How to Create .htaccess Redirects (Most Common Use Cases)<\/a> appeared first on <a href=\"https:\/\/backlinko.com\/\" target=\"_blank\" rel=\"noopener\">Backlinko<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Whenever you move content, change domain names, or simply tweak a page\u2019s URL, you\u2019ll likely use a redirect. This ensures your users (and Google) get to the right page, and it preserves the SEO value from your backlinks. You can use .htaccess redirects specifically to do this. But I get that messing with your site\u2019s server files can sound daunting. So the goal of this guide is to make .htaccess redirects as accessible as possible. To help, there are two free resources you\u2019ll find in this [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":12957,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"h5ap_radio_sources":[],"cybocfi_hide_featured_image":"","footnotes":""},"categories":[8],"tags":[],"class_list":["post-12956","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backlinko"],"featured_image_src":"https:\/\/craighordlow.com\/wp-content\/uploads\/2025\/05\/icon-note-cfg2Bd-600x400.png","featured_image_src_square":"https:\/\/craighordlow.com\/wp-content\/uploads\/2025\/05\/icon-note-cfg2Bd-600x600.png","author_info":{"display_name":false,"author_link":"https:\/\/craighordlow.com\/author\/craig\/"},"_links":{"self":[{"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/posts\/12956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/comments?post=12956"}],"version-history":[{"count":0,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/posts\/12956\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/media\/12957"}],"wp:attachment":[{"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/media?parent=12956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/categories?post=12956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/craighordlow.com\/index.php\/wp-json\/wp\/v2\/tags?post=12956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}