{"id":1019,"date":"2020-08-21T16:14:22","date_gmt":"2020-08-21T16:14:22","guid":{"rendered":"https:\/\/hostingspell.com\/blog\/?p=1019"},"modified":"2020-08-21T16:14:22","modified_gmt":"2020-08-21T16:14:22","slug":"how-to-reset-the-default-htaccess-in-wordpress","status":"publish","type":"post","link":"https:\/\/blog.hostingspell.com\/how-to-reset-the-default-htaccess-in-wordpress\/","title":{"rendered":"How to reset the default .htaccess in WordPress?"},"content":{"rendered":"\n<p style=\"color:#0d5979\" class=\"has-text-color wp-block-paragraph\"><em>If you arrived at this article after seeing error 502 or the white screen of death, then you are at the right place. One of the solutions to fix errors like these is to modify your .htaccess file.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide will help you locate and reset your .htaccess file to its default configuration.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is .htaccess file?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The .htaccess file is essentially a WordPress core file. This file reconfigures certain settings of the Apache webserver. You can control specific features of your server with the help of this file. The .htaccess file handles your WordPress security settings and is used to configure password protection and avoid spambots.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The .htaccess file can be found in the root directory after you install WordPress on your webserver. This is, however, a hidden file and can only be accessed when you enable&nbsp;<strong>Show Hidden File&nbsp;<\/strong>option.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before setting off to modify the .htaccess, we recommend you to create a full backup of your WordPress database. Since this tutorial involves accessing your servers file storage system containing important files, you do not want to find yourself dealing with database loss if anything goes wrong.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Accessing the .htaccess file<\/strong><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The first step you need to do to access .htaccess file is to log in to your server\u2019s control panel or CPanel.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You must use the credentials set by you when you first created your account.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li><strong>Open the server\u2019s file manager<\/strong><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">In your CPanel, click on the icon named&nbsp;<strong><em>File manager<\/em><\/strong>. This will lead you to your WordPress system files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You will know if it is the right folder if it has folders labelled with&nbsp;<strong><em>wp_<\/em><\/strong>.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you can locate the .htaccess file amongst the other files and folder and skip this following step.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you were not able to find the file, it must be because of your web host. The .htacess file will be hidden by default. Hence, you will not be able to view it through the file manager.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this case, the server\u2019s FTP client will be helpful. Open the&nbsp;<strong><em>FTP&nbsp;<\/em><\/strong>icon from your control panel. Create a new&nbsp;<strong><em>FTP account<\/em><\/strong>. Copy the URL given at the top of your page on to your browser\u2019s address bar.<strong><em>&nbsp;<\/em><\/strong>&nbsp;Log in to the page using your FTP details.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\"><li><strong> Locating the .htaccess file<\/strong><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Now, you have finally entered your server\u2019s file storage system \u2013 either through an FTP client or through your file manager. Look through the various files in the root directory, one of these files should be named&nbsp;<strong><em>.htaccess<\/em><\/strong>.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To modify the file, you can just right-click on the file and select the&nbsp;<strong><em>edit&nbsp;<\/em><\/strong>option. You can also download and modify offline.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Resetting the .htaccess file to its default configuration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Follow these simple steps to restore the default file<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Copying the current .htaccess file to a different location<\/strong><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If the .htaccess file is malfunctioning, it is better to back up your current file. Even if it is not working at the time being, it may still hold important information about your server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To create a copy of the file, right-click on the file and select<strong>&nbsp;<em>download.&nbsp;<\/em><\/strong>Do not forget to rename the old file so that you can find it later.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"2\"><li><strong>Creating a new .htaccess file<\/strong><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Making an empty file, at this point, should be easy enough. Right-click in your file manager or FTP client and select&nbsp;<strong><em>create new file&nbsp;<\/em><\/strong>option. Once you are done with it, name your file&nbsp;<strong><em>.htaccess.&nbsp;<\/em><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now for the final step, paste the default WordPress .htaccess code into your new file. To do this, right-click on the new file and choose the&nbsp;<strong><em>edit&nbsp;<\/em><\/strong>option.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Paste the following code into your new file.<\/h4>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<pre class=\"wp-block-code\"><code># BEGIN WordPress\n&lt;IfModule mod_rewrite.c&gt;\nRewriteEngine On\nRewriteBase \/\nRewriteRule ^index\\.php$ - &#091;L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . \/index.php &#091;L]\n&lt;\/IfModule&gt;\n# END WordPress\n<\/code><\/pre>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Finish this up with a click on&nbsp;<strong><em>save and close<\/em><\/strong>!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Give yourself a pat on the back because you have successfully restored the .htaccess file to its default configuration!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Through this guide, you have learnt how to restore the .htaccess file to its default configuration. Try it out, good luck!<\/p>\n\n\n\n<p style=\"font-family:Times New Roman\" class=\"has-text-color has-theme-primary-color has-custom-font wp-block-paragraph\"><em>If you have any further questions, feel free to hit us up in the comments!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you arrived at this article after seeing error 502 or the white screen of death, then you are at the right place. One of the solutions to fix errors like these is to modify your .htaccess file. This guide will help you locate and reset your .htaccess file to its default configuration.&nbsp; What is [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1019","post","type-post","status-publish","format-standard","category-general","entry"],"featured_image_src":null,"featured_image_src_square":null,"author_info":{"display_name":"Nikitha S.","author_link":"https:\/\/blog.hostingspell.com\/author\/nikitha\/"},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"single-featured-image":false,"blog-featured-image":false,"home-featured":false,"ab-block-post-grid-landscape":false,"ab-block-post-grid-square":false,"author-pro-image":false,"gb-block-post-grid-landscape":false,"gb-block-post-grid-square":false},"uagb_author_info":{"display_name":"Nikitha S.","author_link":"https:\/\/blog.hostingspell.com\/author\/nikitha\/"},"uagb_comment_info":9,"uagb_excerpt":"If you arrived at this article after seeing error 502 or the white screen of death, then you are at the right place. One of the solutions to fix errors like these is to modify your .htaccess file. This guide will help you locate and reset your .htaccess file to its default configuration.&nbsp; What is&hellip;","_links":{"self":[{"href":"https:\/\/blog.hostingspell.com\/wp-json\/wp\/v2\/posts\/1019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.hostingspell.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hostingspell.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hostingspell.com\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hostingspell.com\/wp-json\/wp\/v2\/comments?post=1019"}],"version-history":[{"count":0,"href":"https:\/\/blog.hostingspell.com\/wp-json\/wp\/v2\/posts\/1019\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.hostingspell.com\/wp-json\/wp\/v2\/media?parent=1019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hostingspell.com\/wp-json\/wp\/v2\/categories?post=1019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hostingspell.com\/wp-json\/wp\/v2\/tags?post=1019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}