{"id":75007,"date":"2024-07-23T06:42:05","date_gmt":"2024-07-23T06:42:05","guid":{"rendered":"https:\/\/www.awardspace.com\/?p=75007"},"modified":"2024-07-28T06:36:03","modified_gmt":"2024-07-28T06:36:03","slug":"how-to-make-a-301-redirect-using-htaccess","status":"publish","type":"post","link":"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/","title":{"rendered":"How to Make a 301 Redirect Using .htaccess"},"content":{"rendered":"<p>There are multiple ways to make a 301 redirect from one part of your website to another. By far the best way is to use the .<a href=\"https:\/\/www.awardspace.com\/kb\/what-is-htaccess\/\">htaccess configuration file<\/a>. The 301 Redirect is a permanent redirection from one URL to another. Such redirections are useful for SEO, and other reasons but your reason to permanently redirect one URL to another is up to you.<\/p>\n<p>NB! Although it is called a\u00a0<strong>permanent<\/strong> redirect, you can always reverse it, by removing the instructions from your .htaccess file. Yet it is important to note that if a page was 301 redirected, Google and other search engines will accept it as permanent. Therefore, it will be a lot harder to rank the same URL once it was associated to another via a permanent redirect.<\/p>\n<p>&nbsp;<\/p>\n<h2>How to Make a 301 Redirect<\/h2>\n<p>To make a 301 permanent redirect using the .htaccess configuration file, naturally, the first thing you need to do is to access the file. Go to the root directory of your website with our file manager or using an FTP.<\/p>\n<p>Related:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.awardspace.com\/kb\/how-can-i-manage-my-website-files\/\">How can I manage my website files?<\/a><\/li>\n<li><a href=\"https:\/\/www.awardspace.com\/kb\/what-is-ftp-and-ftp-client\/\">What is FTP and FTP Client?<\/a><\/li>\n<li><a href=\"https:\/\/www.awardspace.com\/kb\/file-manager-how-to-use\/\">How to Use the File Manager<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>If the .htaccess file does not exist, create a new file and name it <code>.htaccess<\/code>.<\/p>\n<p>Now that you have created an .htaccess configuration file, simply open the file with any text editor, and add the lines that are needed to make the redirect. Before we go to the lines, we ought to remind you that you can edit the .htaccess file in the hosting control panel. There is no need to download the file, or any additional software.<\/p>\n<p>&nbsp;<\/p>\n<h2>301 Redirect for a Single Page<\/h2>\n<p>To redirect a single page, use the following syntax:<\/p>\n<p><code class=\"!whitespace-pre hljs language-apache\">Redirect 301 \/old-page.html http:\/\/www.yourwebsite.com\/new-page.html<br \/>\n<\/code><\/p>\n<blockquote><p>Replace <code>\/old-page.html<\/code> with the path to the old page. Replace <code>http:\/\/www.yourwebsite.com\/new-page.html<\/code> with the full URL of the new page.<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<h2>301 Redirect an Entire Domain<\/h2>\n<p>To redirect an entire domain to a new domain, use the following syntax:<\/p>\n<p><code class=\"!whitespace-pre hljs language-apache\">RewriteEngine On<br \/>\nRewriteCond %{HTTP_HOST} ^old-domain.com [NC,OR]<br \/>\nRewriteCond %{HTTP_HOST} ^www.old-domain.com [NC]<br \/>\nRewriteRule ^(.*)$ http:\/\/www.new-domain.com\/$1 [L,R=301,NC]<br \/>\n<\/code><\/p>\n<p>&nbsp;<\/p>\n<blockquote><p>Replace <code>old-domain.com<\/code> with your old domain name. Replace <code>http:\/\/www.new-domain.com<\/code> with your new domain name.<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<h2>Redirecting All Pages to a New Domain<\/h2>\n<p>To redirect all pages from an old domain to the corresponding pages on a new domain:<\/p>\n<p><code class=\"!whitespace-pre hljs language-apache\">RewriteEngine On<br \/>\nRewriteCond %{HTTP_HOST} ^old-domain.com$ [NC]<br \/>\nRewriteRule ^(.*)$ http:\/\/new-domain.com\/$1 [R=301,L]<br \/>\n<\/code><\/p>\n<blockquote><p>Replace <code>old-domain.com<\/code> with your old domain name. Replace <code>new-domain.com<\/code> with your new domain name.<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>After you&#8217;ve made the necessary adjustments to your .htaccess file, don&#8217;t forget to save it. Either upload the file back to the website&#8217;s root directory, or if you edited it in the control panel, click the save button.<\/p>\n<p>What is left for you to do is to test whether the redirects are working as intended and whether the website is working as it was before.<\/p>\n<p>&nbsp;<\/p>\n<h2>Example<\/h2>\n<p>If you want to redirect <code>http:\/\/www.yourwebsite.com\/old-page.html<\/code> to <code>http:\/\/www.yourwebsite.com\/new-page.html<\/code>, your .htaccess file should look like this:<\/p>\n<p><code>RewriteEngine On<br \/>\nRedirect 301 \/old-page.html http:\/\/www.yourwebsite.com\/new-page.html<br \/>\n<\/code><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are multiple ways to make a 301 redirect from one part of your website to another. By far the best way is to use the .htaccess configuration file. The 301 Redirect is a permanent redirection from one URL to another. Such redirections are useful for SEO, and other reasons but your reason to permanently [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[78],"tags":[],"class_list":["post-75007","post","type-post","status-publish","format-standard","hentry","category-htaccess"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Make a 301 Redirect Using .htaccess - AwardSpace.com<\/title>\n<meta name=\"description\" content=\"Learn how to make 301 permanent redirects by using the .htaccess configuration file, and whether this is the best way to achieve the result.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Make a 301 Redirect Using .htaccess - AwardSpace.com\" \/>\n<meta property=\"og:description\" content=\"Learn how to make 301 permanent redirects by using the .htaccess configuration file, and whether this is the best way to achieve the result.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/\" \/>\n<meta property=\"og:site_name\" content=\"AwardSpace.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AwardSpace\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-23T06:42:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-28T06:36:03+00:00\" \/>\n<meta name=\"author\" content=\"Lazar Shishmanov, PhD\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@awspace\" \/>\n<meta name=\"twitter:site\" content=\"@awspace\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lazar Shishmanov, PhD\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/\"},\"author\":{\"name\":\"Lazar Shishmanov, PhD\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/person\/13f0961f1cff18623121a6716f08c58b\"},\"headline\":\"How to Make a 301 Redirect Using .htaccess\",\"datePublished\":\"2024-07-23T06:42:05+00:00\",\"dateModified\":\"2024-07-28T06:36:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/\"},\"wordCount\":458,\"publisher\":{\"@id\":\"https:\/\/www.awardspace.com\/#organization\"},\"articleSection\":[\".htaccess\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/\",\"url\":\"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/\",\"name\":\"How to Make a 301 Redirect Using .htaccess - AwardSpace.com\",\"isPartOf\":{\"@id\":\"https:\/\/www.awardspace.com\/#website\"},\"datePublished\":\"2024-07-23T06:42:05+00:00\",\"dateModified\":\"2024-07-28T06:36:03+00:00\",\"description\":\"Learn how to make 301 permanent redirects by using the .htaccess configuration file, and whether this is the best way to achieve the result.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.awardspace.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Knowledge Base\",\"item\":\"https:\/\/www.awardspace.com\/kb\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Website Management \u2013 Advanced\",\"item\":\"https:\/\/www.awardspace.com\/kb\/website-management-advanced\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\".htaccess\",\"item\":\"https:\/\/www.awardspace.com\/kb\/website-management-advanced\/htaccess\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"How to Make a 301 Redirect Using .htaccess\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.awardspace.com\/#website\",\"url\":\"https:\/\/www.awardspace.com\/\",\"name\":\"AwardSpace.com\",\"description\":\"Free Web Hosting with PHP, MySQL, Email Sending, No Ads\",\"publisher\":{\"@id\":\"https:\/\/www.awardspace.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.awardspace.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.awardspace.com\/#organization\",\"name\":\"AwardSpace.com\",\"url\":\"https:\/\/www.awardspace.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png\",\"contentUrl\":\"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png\",\"width\":1759,\"height\":176,\"caption\":\"AwardSpace.com\"},\"image\":{\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/AwardSpace\/\",\"https:\/\/x.com\/awspace\",\"https:\/\/www.instagram.com\/awardspace\/\",\"https:\/\/www.quora.com\/profile\/Award-Space\",\"https:\/\/www.linkedin.com\/company\/19214384\/\",\"https:\/\/www.reddit.com\/user\/AwardSpace\",\"https:\/\/www.pinterest.com\/awardspace\/\",\"https:\/\/www.youtube.com\/user\/AwardspaceWebHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/person\/13f0961f1cff18623121a6716f08c58b\",\"name\":\"Lazar Shishmanov, PhD\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.awardspace.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/341ac134090ebf7e8095d20d79485f8652e19c1d00cfef899e40c69ec4ac10cb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/341ac134090ebf7e8095d20d79485f8652e19c1d00cfef899e40c69ec4ac10cb?s=96&d=mm&r=g\",\"caption\":\"Lazar Shishmanov, PhD\"},\"description\":\"Lazar is a marketing specialist with more than ten years of experience in the field, eight of which as part of the marketing department at AwardSpace. Academically, Lazar holds a Bachelor's degree in Public Relations, a Master's degree in Semiotics, Language and Advertising, and is a PhD candidate in Integrated Marketing Communications. You can learn more about Lazar on his personal website.\",\"url\":\"https:\/\/www.awardspace.com\/author\/lazar\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Make a 301 Redirect Using .htaccess - AwardSpace.com","description":"Learn how to make 301 permanent redirects by using the .htaccess configuration file, and whether this is the best way to achieve the result.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/","og_locale":"en_US","og_type":"article","og_title":"How to Make a 301 Redirect Using .htaccess - AwardSpace.com","og_description":"Learn how to make 301 permanent redirects by using the .htaccess configuration file, and whether this is the best way to achieve the result.","og_url":"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/","og_site_name":"AwardSpace.com","article_publisher":"https:\/\/www.facebook.com\/AwardSpace\/","article_published_time":"2024-07-23T06:42:05+00:00","article_modified_time":"2024-07-28T06:36:03+00:00","author":"Lazar Shishmanov, PhD","twitter_card":"summary_large_image","twitter_creator":"@awspace","twitter_site":"@awspace","twitter_misc":{"Written by":"Lazar Shishmanov, PhD","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/#article","isPartOf":{"@id":"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/"},"author":{"name":"Lazar Shishmanov, PhD","@id":"https:\/\/www.awardspace.com\/#\/schema\/person\/13f0961f1cff18623121a6716f08c58b"},"headline":"How to Make a 301 Redirect Using .htaccess","datePublished":"2024-07-23T06:42:05+00:00","dateModified":"2024-07-28T06:36:03+00:00","mainEntityOfPage":{"@id":"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/"},"wordCount":458,"publisher":{"@id":"https:\/\/www.awardspace.com\/#organization"},"articleSection":[".htaccess"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/","url":"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/","name":"How to Make a 301 Redirect Using .htaccess - AwardSpace.com","isPartOf":{"@id":"https:\/\/www.awardspace.com\/#website"},"datePublished":"2024-07-23T06:42:05+00:00","dateModified":"2024-07-28T06:36:03+00:00","description":"Learn how to make 301 permanent redirects by using the .htaccess configuration file, and whether this is the best way to achieve the result.","breadcrumb":{"@id":"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.awardspace.com\/kb\/how-to-make-a-301-redirect-using-htaccess\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.awardspace.com\/"},{"@type":"ListItem","position":2,"name":"Knowledge Base","item":"https:\/\/www.awardspace.com\/kb\/"},{"@type":"ListItem","position":3,"name":"Website Management \u2013 Advanced","item":"https:\/\/www.awardspace.com\/kb\/website-management-advanced\/"},{"@type":"ListItem","position":4,"name":".htaccess","item":"https:\/\/www.awardspace.com\/kb\/website-management-advanced\/htaccess\/"},{"@type":"ListItem","position":5,"name":"How to Make a 301 Redirect Using .htaccess"}]},{"@type":"WebSite","@id":"https:\/\/www.awardspace.com\/#website","url":"https:\/\/www.awardspace.com\/","name":"AwardSpace.com","description":"Free Web Hosting with PHP, MySQL, Email Sending, No Ads","publisher":{"@id":"https:\/\/www.awardspace.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.awardspace.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.awardspace.com\/#organization","name":"AwardSpace.com","url":"https:\/\/www.awardspace.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png","contentUrl":"https:\/\/www.awardspace.com\/wp-content\/uploads\/2018\/08\/awardspace_logo.png","width":1759,"height":176,"caption":"AwardSpace.com"},"image":{"@id":"https:\/\/www.awardspace.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/AwardSpace\/","https:\/\/x.com\/awspace","https:\/\/www.instagram.com\/awardspace\/","https:\/\/www.quora.com\/profile\/Award-Space","https:\/\/www.linkedin.com\/company\/19214384\/","https:\/\/www.reddit.com\/user\/AwardSpace","https:\/\/www.pinterest.com\/awardspace\/","https:\/\/www.youtube.com\/user\/AwardspaceWebHosting"]},{"@type":"Person","@id":"https:\/\/www.awardspace.com\/#\/schema\/person\/13f0961f1cff18623121a6716f08c58b","name":"Lazar Shishmanov, PhD","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.awardspace.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/341ac134090ebf7e8095d20d79485f8652e19c1d00cfef899e40c69ec4ac10cb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/341ac134090ebf7e8095d20d79485f8652e19c1d00cfef899e40c69ec4ac10cb?s=96&d=mm&r=g","caption":"Lazar Shishmanov, PhD"},"description":"Lazar is a marketing specialist with more than ten years of experience in the field, eight of which as part of the marketing department at AwardSpace. Academically, Lazar holds a Bachelor's degree in Public Relations, a Master's degree in Semiotics, Language and Advertising, and is a PhD candidate in Integrated Marketing Communications. You can learn more about Lazar on his personal website.","url":"https:\/\/www.awardspace.com\/author\/lazar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/posts\/75007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/comments?post=75007"}],"version-history":[{"count":0,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/posts\/75007\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/media?parent=75007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/categories?post=75007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.awardspace.com\/wp-json\/wp\/v2\/tags?post=75007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}