Where can I find the .htaccess file on WordPress Site

Table of Contents

Are you not able to find .htaccess file on your live wordpress site? Learn how to find it in root directory of the server using ftp, or file manager via Cpanel. Also learn how to create .htaccess file without plugin. The .htaccess file is an amazing device given to us by WordPress to perform some radical actions on our website. Of course, the greatness of .htaccess file is lost upon you if you don’t know what it is! Moreover, where do you find it on your website, and what if you can’t find it? Well, not to worry. This article shall cover all the basics about the .htaccess file.

what is .htaccess file and its uses

What is the .htaccess file?

.htaccess stands for hypertext access file. This file is very important as it enables you to change the configuration of many features on your web server. It can be used to redirect webpage/users, password protect the admin area of the web server, protect specific directories, and many such functions.

The dot in front of the file name tells you that it is a hidden file, which means it will not be visible to you when you access your web server with FTP, unless it is enabled to show hidden files. Otherwise you will have to login to the Cpanel, follow these steps:

Cpanel >> File Manager >> Public HTML >> Website Folder

Where can I find my .htaccess file?

In most cases, the .htaccess file can be found in your root directory of your website. More specifically, open your “public_html” folder and you will find it sitting right there. But sometimes, it is possible your file may not be located there.

In most of the cases, .htaccess file is not visible is because your WordPress has not yet generated a .htaccess file. This may be because you have not set up permalinks. But most of the time the htaccess file exists on to the wordpress’s root directory.

How to create a .htaccess file?

Go to Settings and open the Permalinks screen.

Permalink settings in wordpress

Now, click on save changes, and WordPress will automatically generate a .htaccess file in your website’s root directory.

Even after doing all this, if WordPress does not generate a .htaccess file for your website, it may be because of permission issues. This will be indicated by a message at the bottom of your screen by WordPress. It will indicate that the .htaccess file is not writable. In addition to this, if your permalinks is setup to anything other than default, it will also give you the code that needs to be in your .htaccess file.

It gets simpler now. Copy the text that appears below the message, and paste it to a text editor like notepad. Now, you need to save this file as an .htaccess file anywhere on your system. Now you have an .htaccess file ready. Connect to your website using any FTP client, and upload your newly made .htaccess file into the root directory of your web server.

Although there are few plugins available that creates .htacess file for you, but its good idea to create own.

× Live Chat