{"id":5924,"date":"2024-09-13T09:00:00","date_gmt":"2024-09-13T08:00:00","guid":{"rendered":"https:\/\/harmonweb.com\/blog\/?p=5924"},"modified":"2024-09-09T16:19:49","modified_gmt":"2024-09-09T15:19:49","slug":"how-to-remove-file-extensions-using-htaccess-in-cpanel","status":"publish","type":"post","link":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/","title":{"rendered":"How To Remove File Extensions using .htaccess In cPanel"},"content":{"rendered":"\n<p>In this tutorial, I will show you how to remove file extensions using .htaccess in cPanel.<\/p>\n\n\n\n<p>There are different types of files in .htaccess, and it may include files like php, html, or asp files. However, having most of this files in your server may affect your website\u2019s SEO and you may want to remove the file extensions that are unnecessary. Following this guide, you can easily complete the process.<\/p>\n\n\n\n<p>Let&#8217;s get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How To Remove File Extensions Using .htaccess In cPanel<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Log into your cPanel.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to the <strong>Files<\/strong> section and select <strong>File Manager<\/strong>.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"582\" height=\"232\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/1000095617-1.jpg\" alt=\"remove file extensions\" class=\"wp-image-5926\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/1000095617-1.jpg 582w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/1000095617-1-300x120.jpg 300w\" sizes=\"auto, (max-width: 582px) 100vw, 582px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In the File Manager, go to the<strong> .htaccess file<\/strong>. If you can&#8217;t locate it, you can set the File Manager to <strong>show hidden files<\/strong>.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Right-click on the .htaccess file and select <strong>Edit<\/strong> from the pop-up option that appears.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"720\" height=\"400\" src=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/1000095651.jpg\" alt=\"remove file extensions\" class=\"wp-image-5927\" srcset=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/1000095651.jpg 720w, https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/1000095651-300x167.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You will be taken to the text code editor. Since most sites are coded with php or html, I have outlined the code for both below:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>RewriteEngine on\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_FILENAME}.php -f\nRewriteRule ^(.*)$ $1.php\n\nRewriteEngine on\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_FILENAME}.html -f\nRewriteRule ^(.*)$ $1.html\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When you are done, you click on <strong>Save Changes<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p>You have successfully removed file extensions using .htaccess in cPanel. If you have any questions, leave it in the comment section. I will love to hear from you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, I will show you how to remove file extensions using .htaccess in cPanel. There are&hellip;<\/p>\n","protected":false},"author":1,"featured_media":5928,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[158],"tags":[],"class_list":["post-5924","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-troubleshooting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Remove File Extensions using .htaccess In cPanel | HarmonWeb Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Remove File Extensions using .htaccess In cPanel | HarmonWeb Blog\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, I will show you how to remove file extensions using .htaccess in cPanel. There are&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/\" \/>\n<meta property=\"og:site_name\" content=\"HarmonWeb Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-09-13T08:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/Remove-file-extension-_20240909_155055_0000.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"John Adegoke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Adegoke\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/\"},\"author\":{\"name\":\"John Adegoke\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#\\\/schema\\\/person\\\/e9bc75c3e7e30a261690c47ec872a8fc\"},\"headline\":\"How To Remove File Extensions using .htaccess In cPanel\",\"datePublished\":\"2024-09-13T08:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/\"},\"wordCount\":208,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/Remove-file-extension-_20240909_155055_0000.png\",\"articleSection\":[\"Troubleshooting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/\",\"name\":\"How To Remove File Extensions using .htaccess In cPanel | HarmonWeb Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/Remove-file-extension-_20240909_155055_0000.png\",\"datePublished\":\"2024-09-13T08:00:00+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/#primaryimage\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/Remove-file-extension-_20240909_155055_0000.png\",\"contentUrl\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/09\\\/Remove-file-extension-_20240909_155055_0000.png\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/how-to-remove-file-extensions-using-htaccess-in-cpanel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Remove File Extensions using .htaccess In cPanel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/\",\"name\":\"HarmonWeb Blog\",\"description\":\"HarmonWeb\",\"publisher\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#organization\",\"name\":\"HarmonWeb\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/cropped-HARMON-WEB-LOGO-2.png\",\"contentUrl\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/cropped-HARMON-WEB-LOGO-2.png\",\"width\":831,\"height\":172,\"caption\":\"HarmonWeb\"},\"image\":{\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/#\\\/schema\\\/person\\\/e9bc75c3e7e30a261690c47ec872a8fc\",\"name\":\"John Adegoke\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/litespeed\\\/avatar\\\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677\",\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/litespeed\\\/avatar\\\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677\",\"contentUrl\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/wp-content\\\/litespeed\\\/avatar\\\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677\",\"caption\":\"John Adegoke\"},\"sameAs\":[\"https:\\\/\\\/harmonweb.com\\\/blog\"],\"url\":\"https:\\\/\\\/harmonweb.com\\\/blog\\\/author\\\/harmonweb\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Remove File Extensions using .htaccess In cPanel | HarmonWeb Blog","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:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/","og_locale":"en_US","og_type":"article","og_title":"How To Remove File Extensions using .htaccess In cPanel | HarmonWeb Blog","og_description":"In this tutorial, I will show you how to remove file extensions using .htaccess in cPanel. There are&hellip;","og_url":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/","og_site_name":"HarmonWeb Blog","article_published_time":"2024-09-13T08:00:00+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/Remove-file-extension-_20240909_155055_0000.png","type":"image\/png"}],"author":"John Adegoke","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Adegoke","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/#article","isPartOf":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/"},"author":{"name":"John Adegoke","@id":"https:\/\/harmonweb.com\/blog\/#\/schema\/person\/e9bc75c3e7e30a261690c47ec872a8fc"},"headline":"How To Remove File Extensions using .htaccess In cPanel","datePublished":"2024-09-13T08:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/"},"wordCount":208,"commentCount":0,"publisher":{"@id":"https:\/\/harmonweb.com\/blog\/#organization"},"image":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/Remove-file-extension-_20240909_155055_0000.png","articleSection":["Troubleshooting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/","url":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/","name":"How To Remove File Extensions using .htaccess In cPanel | HarmonWeb Blog","isPartOf":{"@id":"https:\/\/harmonweb.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/#primaryimage"},"image":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/#primaryimage"},"thumbnailUrl":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/Remove-file-extension-_20240909_155055_0000.png","datePublished":"2024-09-13T08:00:00+00:00","breadcrumb":{"@id":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/#primaryimage","url":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/Remove-file-extension-_20240909_155055_0000.png","contentUrl":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2024\/09\/Remove-file-extension-_20240909_155055_0000.png","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/harmonweb.com\/blog\/how-to-remove-file-extensions-using-htaccess-in-cpanel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/harmonweb.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Remove File Extensions using .htaccess In cPanel"}]},{"@type":"WebSite","@id":"https:\/\/harmonweb.com\/blog\/#website","url":"https:\/\/harmonweb.com\/blog\/","name":"HarmonWeb Blog","description":"HarmonWeb","publisher":{"@id":"https:\/\/harmonweb.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/harmonweb.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/harmonweb.com\/blog\/#organization","name":"HarmonWeb","url":"https:\/\/harmonweb.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/harmonweb.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2020\/06\/cropped-HARMON-WEB-LOGO-2.png","contentUrl":"https:\/\/harmonweb.com\/blog\/wp-content\/uploads\/2020\/06\/cropped-HARMON-WEB-LOGO-2.png","width":831,"height":172,"caption":"HarmonWeb"},"image":{"@id":"https:\/\/harmonweb.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/harmonweb.com\/blog\/#\/schema\/person\/e9bc75c3e7e30a261690c47ec872a8fc","name":"John Adegoke","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/harmonweb.com\/blog\/wp-content\/litespeed\/avatar\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677","url":"https:\/\/harmonweb.com\/blog\/wp-content\/litespeed\/avatar\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677","contentUrl":"https:\/\/harmonweb.com\/blog\/wp-content\/litespeed\/avatar\/0843e926db683e41ace2aee54210b841.jpg?ver=1776839677","caption":"John Adegoke"},"sameAs":["https:\/\/harmonweb.com\/blog"],"url":"https:\/\/harmonweb.com\/blog\/author\/harmonweb\/"}]}},"_links":{"self":[{"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/posts\/5924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/comments?post=5924"}],"version-history":[{"count":2,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/posts\/5924\/revisions"}],"predecessor-version":[{"id":5929,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/posts\/5924\/revisions\/5929"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/media\/5928"}],"wp:attachment":[{"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/media?parent=5924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/categories?post=5924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/harmonweb.com\/blog\/wp-json\/wp\/v2\/tags?post=5924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}