Top reasons Why You Can’t Find the .htaccess File in WordPress
Are you not finding the .htaccess file in WordPress? This is a very common problem that most WordPress users deal with. Most people learn of this issue when they want to edit the .htaccess file or to fix some WordPress errors. In this post we shall be looking at the top reasons why you can’t find the .htaccess file.
What is the .htaccess file?
This is the server configuration file that tells a server how to handle certain things on a website such as how to redirect users, protect some directories, password protect admin area and so on. This file is located in the root folder of your WordPress website. WordPress uses the file to manage permalinks and redirects.
Why can’t you find the .htaccess file?
Although it is a powerful tool, there are times you might not be able to find the .htaccess file in WordPress. There are basically two main reasons why this happens. Let’s look at these reasons.
-
Your FTP Client is not showing hidden files
This is the most common reason why you can’t find the .htaccess file. The dot in front of the htaccess means the file is hidden. By default, when you connect to the WordPress hosting server using FTP client, the file will be hidden and thus will not show. To make it visible, you have to change the settings of your FTP client.
If you are using FileZilla, you have to find the option under the Server>>Force showing hidden files’ menu. For the File Manager app, you go to the cPanel and select the option of ‘show hidden files (dotfiles)’. Options for showing hidden files on FTP clients differ. You can just Google how to show hidden files on your FTP client. After you enable this option you should be able to find the .htaccess file.
-
The .htaccess File Doesn’t exist
If you still don’t find the .htaccess file after following the steps in the first option, there is a chance the .htaccess file doesn’t exist. The reason the file might be missing is because WordPress has not generate it yet.
If the .htaccess file is missing, visit Settings>>Permalinks page and click on ‘Save Changes’ button without making any changes. WordPress will now generate the .htaccess file. In some rare occasions WordPress might be unable to generate the file. If this happens, go to Settings>>Permalinks page and you will find a message that says .htaccess file is not writeable. You have to create the file manually.
Manually creating a .htaccess file
You need to copy and paste the below code in a text editor and save it on your computer as .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mysite/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME}!-f
RewriteCond %{REQUEST_FILENAME}!-d
You then need to connect your site using FTP client and upload the .htaccess file from the desktop. You are done.