{"id":101,"date":"2023-10-06T08:39:39","date_gmt":"2023-10-06T08:39:39","guid":{"rendered":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/?p=101"},"modified":"2023-10-09T06:32:24","modified_gmt":"2023-10-09T06:32:24","slug":"How-do-I-Redirect-my-site-using-a-dot-htaccess-file","status":"publish","type":"post","link":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html","title":{"rendered":"How do I Redirect my site using a (dot) htaccess file ?"},"content":{"rendered":"<div class=\"kb-article-content\">\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">This document will explain how to create a .htaccess file to redirect your site or site content. This will not redirect any emails for your domains.<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">As a configuration file, .htaccess is very powerful. Even the slightest syntax error (like a missing space) can result in your content not displaying correctly or at all. Since .htaccess is a hidden system file, please make sure your FTP client is configured to show hidden files. This is usually an option in the program&#8217;s preferences\/options.<\/span><\/p>\n<p><span style=\"text-decoration: underline;\"><strong><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">INSTRUCTIONS<\/span><\/strong><\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\"><strong>1<\/strong>. Create an empty text file using a text editor such as notepad, and save it as htaccess.txt.<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\"><strong>2<\/strong>. Edit the contents of the file. Check the following examples:<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp;<strong>301 (Permanent) Redirect<\/strong>: Point an entire site to a different URL on a permanent basis. This is the most common type of redirect and is useful in most situations. In this example, we are redirecting to the &#8220;hostitsmart- example.com&#8221; domain:<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# This allows you to redirect your entire website to any other domain<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<strong>Redirect 301 \/ http:\/\/hostitsmart-example.com\/<\/strong><\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp;<strong>302 (Temporary) Redirect<\/strong>: Point an entire site to a different temporary URL. This is useful for SEO purposes when you have a temporary landing page and plan to switch back to your main landing page at a later date:<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# This allows you to redirect your entire website to any other domain<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\"><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>&nbsp;Redirect 302 \/ http:\/\/hostitsmart-example.com\/<\/strong><\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp;<strong>Redirect index.html to a specific subfolder<\/strong>:<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# This allows you to redirect index.html to a specific subfolder<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\"><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>&nbsp;Redirect \/index.html http:\/\/example.com\/newdirectory\/<\/strong><\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp;<strong>Redirect an old file to a new file path<\/strong>:<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# Redirect old file path to new file path<br \/>\n<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <strong>Redirect \/olddirectory\/oldfile.html http:\/\/example.com\/newdirectory\/newfile.html<\/strong><br \/>\n<\/span><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp;<strong>Redirect to a specific index page<\/strong>:<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Provide Specific Index Page (Set the default handler)<br \/>\n<\/span><br \/>\n<span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DirectoryIndex index.html<\/span><\/p>\n<p><span style=\"font-family: arial, helvetica, sans-serif; font-size: medium;\"><strong>3<\/strong>. Upload this file and re-name it to .htaccess.<\/span><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This document will explain how to create a .htaccess file to redirect your site or site content. This will not redirect any emails for your domains. As a configuration file, .htaccess is very powerful. Even the slightest syntax error (like a missing space) can result in your content not displaying correctly or at all. Since [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-101","post","type-post","status-publish","format-standard","hentry","category-cpanel"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How do I Redirect my site using a (dot) htaccess file ?<\/title>\n<meta name=\"description\" content=\"This write up will explain how to create a .htaccess file to redirect your site or site content.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How do I Redirect my site using a (dot) htaccess file ?\" \/>\n<meta property=\"og:description\" content=\"This write up will explain how to create a .htaccess file to redirect your site or site content.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html\" \/>\n<meta property=\"og:site_name\" content=\"Host IT Smart Knowledge base\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-06T08:39:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-09T06:32:24+00:00\" \/>\n<meta name=\"author\" content=\"Admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html#article\",\"isPartOf\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html\"},\"author\":{\"name\":\"Admin\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9\"},\"headline\":\"How do I Redirect my site using a (dot) htaccess file ?\",\"datePublished\":\"2023-10-06T08:39:39+00:00\",\"dateModified\":\"2023-10-09T06:32:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html\"},\"wordCount\":412,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization\"},\"articleSection\":[\"cPanel\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html\",\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html\",\"name\":\"How do I Redirect my site using a (dot) htaccess file ?\",\"isPartOf\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website\"},\"datePublished\":\"2023-10-06T08:39:39+00:00\",\"dateModified\":\"2023-10-09T06:32:24+00:00\",\"description\":\"This write up will explain how to create a .htaccess file to redirect your site or site content.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website\",\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/\",\"name\":\"Host IT Smart Knowledge base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization\",\"name\":\"Host IT Smart Knowledge base\",\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/\",\"url\":\"\",\"contentUrl\":\"\",\"width\":240,\"height\":80,\"caption\":\"Host IT Smart Knowledge base\"},\"image\":{\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9\",\"name\":\"Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g\",\"caption\":\"Admin\"},\"sameAs\":[\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/\"],\"url\":\"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How do I Redirect my site using a (dot) htaccess file ?","description":"This write up will explain how to create a .htaccess file to redirect your site or site content.","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:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html","og_locale":"en_US","og_type":"article","og_title":"How do I Redirect my site using a (dot) htaccess file ?","og_description":"This write up will explain how to create a .htaccess file to redirect your site or site content.","og_url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html","og_site_name":"Host IT Smart Knowledge base","article_published_time":"2023-10-06T08:39:39+00:00","article_modified_time":"2023-10-09T06:32:24+00:00","author":"Admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html#article","isPartOf":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html"},"author":{"name":"Admin","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9"},"headline":"How do I Redirect my site using a (dot) htaccess file ?","datePublished":"2023-10-06T08:39:39+00:00","dateModified":"2023-10-09T06:32:24+00:00","mainEntityOfPage":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html"},"wordCount":412,"commentCount":0,"publisher":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization"},"articleSection":["cPanel"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html","url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html","name":"How do I Redirect my site using a (dot) htaccess file ?","isPartOf":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website"},"datePublished":"2023-10-06T08:39:39+00:00","dateModified":"2023-10-09T06:32:24+00:00","description":"This write up will explain how to create a .htaccess file to redirect your site or site content.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/101\/How-do-I-Redirect-my-site-using-a-dot-htaccess-file.html"]}]},{"@type":"WebSite","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#website","url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/","name":"Host IT Smart Knowledge base","description":"","publisher":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#organization","name":"Host IT Smart Knowledge base","url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/","url":"","contentUrl":"","width":240,"height":80,"caption":"Host IT Smart Knowledge base"},"image":{"@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/8b538056beea86b043adbd20df3a6ee9","name":"Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/17348df3a33347d3945161d87b752de1d7a7ec25dcbe15baacbd3b8a35367f66?s=96&d=mm&r=g","caption":"Admin"},"sameAs":["https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/"],"url":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/101","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"count":1,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/101\/revisions"}],"predecessor-version":[{"id":405,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/101\/revisions\/405"}],"wp:attachment":[{"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/media?parent=101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/categories?post=101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/new.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/tags?post=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}