Why You Can’t Find .htaccess file on Your WordPress Site?Are you ever face issues finding .htaccess file on your WordPress site? Many visitors asks why i cannot find my .htaccess file? Sometimes you need to make edits in your .htaccess file or delete it to fix common WordPress errors. Here we will explain you why you can’t find .htaccess file in WordPress and how to easily locate it.
What is .htaccess file?
The .htaccess file is server configuration file which tells server how to handle things on website. Like how to redirects users, protect some directories, and protect admin area. It is located in root folder of your directory. WordPress make use of it to redirects & permalinks.
This is incredibly powerful configuration file and can be used to do lots of things.
Why I can’t find .htaccess file?
There are mainly two reasons for not finding .htaccess file in website’s root folder. It’s either hidden by file manager software or it doesn’t exist. Here we have explained both the reasons.
Why You Can’t Find .htaccess file on Your WordPress Site?
- Your FTP Client is not showing hidden files:- dot before htaccess indicates that it is hidden file. By default, when you connect to hosting server using FTP client, it will show hidden files.
To show hidden files visible you need to change FTP client settings.
For instance- in FileZilla, you can find option in Server>> Force Showing Hidden Files menu.
If you are using file manager app in cpanel, then you will find option to show hidden files before launching the app.
For other FTP client, you find the option to show hidden files in app setting or preferences menu.
After enable this option, you will be able to show hidden files including .htaccess file for your site.
- .htaccess file doesn’t exist:- the 2nd most important reason for not finding .htaccess file is that your WordPress site has not generated it yet.
WordPress generates .htaccess file automatically because it is needed to properly redirect permalinks.
If your .htaccess file is missing then initially you need to navigate Settings>>Permalinks page and click on save change button without making changes.
Now WordPress will try to generate .htaccess file for you. In rare cases, WordPress might not be able to generate it due to permission rules.
In that situation, It will show a message at bottom of Settings>> permalinks saying .htaccess file is not writable.
You need to manually create .htaccess file and add the required code inside.
Simply copy & paste the code in text editor like notepad. Now save it as .htaccess file on desktop. If you get errors while uploading the file, you need to change file permission for root directory.
Suppose your WordPress files resides under:
/home/johnsmith/public_html/directory.
This will make public_html folder you root directory. You need to navigate to its root directory and click on public_html folder. Select file permission which opens a file permission box.
Now enter 755 in the file permission dialog box and then try to upload .htaccess file to public_html folder.