{"id":6586,"date":"2022-04-20T11:15:34","date_gmt":"2022-04-20T16:15:34","guid":{"rendered":"https:\/\/www.knownhost.com\/kb\/?p=6586"},"modified":"2022-06-13T07:31:48","modified_gmt":"2022-06-13T12:31:48","slug":"how-to-modify-the-htaccess-file","status":"publish","type":"post","link":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/","title":{"rendered":"How to modify the .htaccess file?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-custom 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: #212121;color:#212121\" 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: #212121;color:#212121\" 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 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/#using_cpanel\" >Using cPanel<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/#using_directadmin\" >Using DirectAdmin<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/#using_ssh\" >Using SSH<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/#conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n\n<p>The .htacceess files provide the way to perform the configuration on a per-directory basis. In this article, we will cover how to modify the .htaccess files on cPanel, DirectAdmin, and using SSH. Let&#8217;s get started!<\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"using_cpanel\"><\/span>Using cPanel<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>1. Log in to cPanel using&nbsp;<strong>Username&nbsp;<\/strong>&amp;&nbsp;<strong>Password<\/strong>.&nbsp;i.e;&nbsp;<em>(https:\/\/yourdomain.com:2083 or https:\/\/yourdomain.com\/cpanel)<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/Login-to-cpanel-using-user-and-password.png\" alt=\"\" class=\"wp-image-2388\"\/><\/figure>\n\n\n\n<p>2. Navigate and open&nbsp;<strong>Files \u2192 File Manager<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/navigate-to-file-manager-in-cpanel-1024x560.jpg\" alt=\"\" class=\"wp-image-2478\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/navigate-to-file-manager-in-cpanel-1024x560.jpg 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/navigate-to-file-manager-in-cpanel-300x164.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/navigate-to-file-manager-in-cpanel-768x420.jpg 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/navigate-to-file-manager-in-cpanel.jpg 1435w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>3. &nbsp;<strong>Navigate<\/strong> to&nbsp;<strong>public_html<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"715\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/navigate-to-public-html-to-upload-the-data-1024x715.jpg\" alt=\"\" class=\"wp-image-2479\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/navigate-to-public-html-to-upload-the-data-1024x715.jpg 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/navigate-to-public-html-to-upload-the-data-300x210.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/navigate-to-public-html-to-upload-the-data-768x536.jpg 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/navigate-to-public-html-to-upload-the-data.jpg 1124w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>4. <strong>Select<\/strong> the .<strong>htaccess<\/strong> file \u2192 <strong>Click<\/strong> on <strong>Edit<\/strong>. If you cannot find the .htaccess file, that is probably because the &#8220;Show Hidden File&#8221; option must be disabled. To enable the hidden files, <a href=\"https:\/\/www.knownhost.com\/kb\/how-to-use-cpanel-file-manager\/#enable_hidden_files\">follow this article<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"505\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/select-htaccess-file-click-on-edit-1024x505.jpg\" alt=\"select htaccess file click on edit\" class=\"wp-image-6592\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/select-htaccess-file-click-on-edit-1024x505.jpg 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/select-htaccess-file-click-on-edit-300x148.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/select-htaccess-file-click-on-edit-768x379.jpg 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/select-htaccess-file-click-on-edit-1536x758.jpg 1536w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/select-htaccess-file-click-on-edit.jpg 1780w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>5. In another tab, the editor will open, enabling the access to edit the .htaccess file. Once the required changes are made, click on <strong>SAVE<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"408\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-file-using-cpanel-1024x408.jpg\" alt=\"how to edit htaccess file using cpanel\" class=\"wp-image-6591\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-file-using-cpanel-1024x408.jpg 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-file-using-cpanel-300x120.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-file-using-cpanel-768x306.jpg 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-file-using-cpanel-1536x613.jpg 1536w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-file-using-cpanel.jpg 1780w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"using_directadmin\"><\/span>Using DirectAdmin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>1. First, to login into DirectAdmin control panel visit,<strong><em>&nbsp;<\/em><\/strong><\/p>\n\n\n\n<p><strong>https:\/\/your-domain.com:2222<\/strong>&nbsp;or&nbsp;<strong>https:\/\/IP-address:2222<\/strong>&nbsp;or&nbsp;<strong>https:\/\/server-hostname:2222<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"706\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/09\/login-into-directadmin-1024x706.jpg\" alt=\"login-into-directadmin\" class=\"wp-image-2985\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/09\/login-into-directadmin-1024x706.jpg 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/09\/login-into-directadmin-300x207.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/09\/login-into-directadmin-768x530.jpg 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/09\/login-into-directadmin.jpg 1364w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>2. Navigate to&nbsp;<strong>System Info &amp; Files<\/strong>&nbsp;\u2192&nbsp;<strong>File Manager<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"1024\" height=\"664\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/09\/navigate-to-file-manager-directadmin-1024x664.jpg\" alt=\"navigate-to-file-manager-directadmin\" class=\"wp-image-3400\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/09\/navigate-to-file-manager-directadmin-1024x664.jpg 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/09\/navigate-to-file-manager-directadmin-300x195.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/09\/navigate-to-file-manager-directadmin-768x498.jpg 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/09\/navigate-to-file-manager-directadmin.jpg 1361w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>3. <strong>Navigate<\/strong> to <strong>public_html<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"494\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/navigate-to-public_html-directadmin-1024x494.jpg\" alt=\"navigate to public_html directadmin\" class=\"wp-image-6595\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/navigate-to-public_html-directadmin-1024x494.jpg 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/navigate-to-public_html-directadmin-300x145.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/navigate-to-public_html-directadmin-768x371.jpg 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/navigate-to-public_html-directadmin-1536x741.jpg 1536w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/navigate-to-public_html-directadmin.jpg 1780w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>4. <strong>Select<\/strong> the .<strong>htaccess<\/strong> file \u2192 <strong>Click<\/strong> on <strong>Edit<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"522\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/right-click-on-htaccess-file-click-on-edit-directadmin-1024x522.jpg\" alt=\"right click on htaccess file click on edit directadmin\" class=\"wp-image-6596\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/right-click-on-htaccess-file-click-on-edit-directadmin-1024x522.jpg 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/right-click-on-htaccess-file-click-on-edit-directadmin-300x153.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/right-click-on-htaccess-file-click-on-edit-directadmin-768x392.jpg 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/right-click-on-htaccess-file-click-on-edit-directadmin-1536x784.jpg 1536w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/right-click-on-htaccess-file-click-on-edit-directadmin.jpg 1684w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>5. Once the changes are made, click on <strong>Save<\/strong> <strong>File<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"476\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-in-directadmin-1024x476.jpg\" alt=\"how to edit htaccess in directadmin\" class=\"wp-image-6594\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-in-directadmin-1024x476.jpg 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-in-directadmin-300x139.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-in-directadmin-768x357.jpg 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-in-directadmin-1536x713.jpg 1536w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-in-directadmin.jpg 1684w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"using_ssh\"><\/span>Using SSH<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Except GUI method SSH method requires slight SSH knowledge to perform the modification in .htaccess file. In this sectiom, you will learn about to how to view\/edit dot\/hidden files using SSH.<\/p>\n\n\n\n<p>To view hidden\/dot files using following command,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -a<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"928\" height=\"890\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/search-hidden-dot-files-using-ssh.jpg\" alt=\"search hidden dot files using ssh\" class=\"wp-image-6599\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/search-hidden-dot-files-using-ssh.jpg 928w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/search-hidden-dot-files-using-ssh-300x288.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/search-hidden-dot-files-using-ssh-768x737.jpg 768w\" sizes=\"(max-width: 928px) 100vw, 928px\" \/><\/figure>\n\n\n\n<p>To edit the .htaccess file you can take the help of any text editor (vi, vim, nano, etc.). For this article, we will use vi text editor,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi .htaccess<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"723\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/edit-the-htaccess-file-with-vi-editor--1024x723.jpg\" alt=\"edit the htaccess file with vi editor\" class=\"wp-image-6597\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/edit-the-htaccess-file-with-vi-editor--1024x723.jpg 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/edit-the-htaccess-file-with-vi-editor--300x212.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/edit-the-htaccess-file-with-vi-editor--768x542.jpg 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/edit-the-htaccess-file-with-vi-editor-.jpg 1037w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>To save the changes and exit, <strong>Press<\/strong> <strong>Esc<\/strong> \u2192 type <strong>:wq!<\/strong> (w= write, q=quit, !=force).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"762\" src=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-file-using-ssh-1024x762.jpg\" alt=\"how to edit htaccess file using ssh\" class=\"wp-image-6598\" srcset=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-file-using-ssh-1024x762.jpg 1024w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-file-using-ssh-300x223.jpg 300w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-file-using-ssh-768x571.jpg 768w, https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2022\/04\/how-to-edit-htaccess-file-using-ssh.jpg 1289w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\"><span class=\"ez-toc-section\" id=\"conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Now that we\u2019ve gone over how to modify the .htaccess file using cPanel, DirectAdmin, and SSH. This one-stop article will guide you through the step-by-step procedure to modify the .htaccess file.<\/p>\n\n\n\n<p>KnownHost offers 365 days a year, 24 hours a day, all 7 days of the week best in class technical support. A dedicated team is ready to help you with requests should you need our assistance. You\u2019re not using KnownHost for the best web hosting experience? Well, why not? Check with&nbsp;our Sales team&nbsp;to see what can&nbsp;KnownHost&nbsp;do for you in improving your web hosting experience.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The .htacceess files provide the way to perform the configuration on a per-directory basis. In this article, we will cover how to modify the .htaccess files on cPanel, DirectAdmin, and using SSH. Let&#8217;s get started! Using cPanel 1. Log in to cPanel using&nbsp;Username&nbsp;&amp;&nbsp;Password.&nbsp;i.e;&nbsp;(https:\/\/yourdomain.com:2083 or https:\/\/yourdomain.com\/cpanel) 2. Navigate and open&nbsp;Files \u2192 File Manager. 3. &nbsp;Navigate to&nbsp;public_html. [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91],"tags":[109,128,238,123],"class_list":["post-6586","post","type-post","status-publish","format-standard","hentry","category-guides","tag-cpanel","tag-directadmin","tag-htaccess","tag-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to modify the .htaccess file? - KnownHost<\/title>\n<meta name=\"description\" content=\"Descriptive article with a step-by-step procedure on how to modify the .htaccess file using cPanel, DirectAdmin, and SSH.\" \/>\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.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to modify the .htaccess file? - KnownHost\" \/>\n<meta property=\"og:description\" content=\"Descriptive article with a step-by-step procedure on how to modify the .htaccess file using cPanel, DirectAdmin, and SSH.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/\" \/>\n<meta property=\"og:site_name\" content=\"KnownHost\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-20T16:15:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-06-13T12:31:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/Login-to-cpanel-using-user-and-password.png\" \/>\n<meta name=\"author\" content=\"Somesh Z\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Somesh Z\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/\"},\"author\":{\"name\":\"Somesh Z\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/8b518f13cf69dd00d147e577d63ff3b1\"},\"headline\":\"How to modify the .htaccess file?\",\"datePublished\":\"2022-04-20T16:15:34+00:00\",\"dateModified\":\"2022-06-13T12:31:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/\"},\"wordCount\":380,\"image\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Login-to-cpanel-using-user-and-password.png\",\"keywords\":[\"cpanel\",\"directadmin\",\"htaccess\",\"linux\"],\"articleSection\":[\"Guides\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/\",\"name\":\"How to modify the .htaccess file? - KnownHost\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Login-to-cpanel-using-user-and-password.png\",\"datePublished\":\"2022-04-20T16:15:34+00:00\",\"dateModified\":\"2022-06-13T12:31:48+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/8b518f13cf69dd00d147e577d63ff3b1\"},\"description\":\"Descriptive article with a step-by-step procedure on how to modify the .htaccess file using cPanel, DirectAdmin, and SSH.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Login-to-cpanel-using-user-and-password.png\",\"contentUrl\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/Login-to-cpanel-using-user-and-password.png\",\"width\":1002,\"height\":829},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/how-to-modify-the-htaccess-file\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to modify the .htaccess file?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/\",\"name\":\"KnownHost\",\"description\":\"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.knownhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/8b518f13cf69dd00d147e577d63ff3b1\",\"name\":\"Somesh Z\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g\",\"caption\":\"Somesh Z\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to modify the .htaccess file? - KnownHost","description":"Descriptive article with a step-by-step procedure on how to modify the .htaccess file using cPanel, DirectAdmin, and SSH.","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.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/","og_locale":"en_US","og_type":"article","og_title":"How to modify the .htaccess file? - KnownHost","og_description":"Descriptive article with a step-by-step procedure on how to modify the .htaccess file using cPanel, DirectAdmin, and SSH.","og_url":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/","og_site_name":"KnownHost","article_published_time":"2022-04-20T16:15:34+00:00","article_modified_time":"2022-06-13T12:31:48+00:00","og_image":[{"url":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/Login-to-cpanel-using-user-and-password.png","type":"","width":"","height":""}],"author":"Somesh Z","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Somesh Z","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/#article","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/"},"author":{"name":"Somesh Z","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/8b518f13cf69dd00d147e577d63ff3b1"},"headline":"How to modify the .htaccess file?","datePublished":"2022-04-20T16:15:34+00:00","dateModified":"2022-06-13T12:31:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/"},"wordCount":380,"image":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/#primaryimage"},"thumbnailUrl":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/Login-to-cpanel-using-user-and-password.png","keywords":["cpanel","directadmin","htaccess","linux"],"articleSection":["Guides"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/","url":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/","name":"How to modify the .htaccess file? - KnownHost","isPartOf":{"@id":"https:\/\/www.knownhost.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/#primaryimage"},"image":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/#primaryimage"},"thumbnailUrl":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/Login-to-cpanel-using-user-and-password.png","datePublished":"2022-04-20T16:15:34+00:00","dateModified":"2022-06-13T12:31:48+00:00","author":{"@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/8b518f13cf69dd00d147e577d63ff3b1"},"description":"Descriptive article with a step-by-step procedure on how to modify the .htaccess file using cPanel, DirectAdmin, and SSH.","breadcrumb":{"@id":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/#primaryimage","url":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/Login-to-cpanel-using-user-and-password.png","contentUrl":"https:\/\/www.knownhost.com\/kb\/wp-content\/uploads\/2021\/08\/Login-to-cpanel-using-user-and-password.png","width":1002,"height":829},{"@type":"BreadcrumbList","@id":"https:\/\/www.knownhost.com\/kb\/how-to-modify-the-htaccess-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.knownhost.com\/kb\/"},{"@type":"ListItem","position":2,"name":"How to modify the .htaccess file?"}]},{"@type":"WebSite","@id":"https:\/\/www.knownhost.com\/kb\/#website","url":"https:\/\/www.knownhost.com\/kb\/","name":"KnownHost","description":"KnownHost provides a comprehensive webhosting knowledge base to help answer many of your common webhosting and linux questions.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.knownhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.knownhost.com\/kb\/#\/schema\/person\/8b518f13cf69dd00d147e577d63ff3b1","name":"Somesh Z","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/276c97317c2d6905cc5a1bd9ceb10a0fd121cc4da22126f648fa88f95dcf32dd?s=96&d=mm&r=g","caption":"Somesh Z"}}]}},"_links":{"self":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/6586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/comments?post=6586"}],"version-history":[{"count":0,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/posts\/6586\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/media?parent=6586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/categories?post=6586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.knownhost.com\/kb\/wp-json\/wp\/v2\/tags?post=6586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}