Where is my .htaccess file? [2024] 💥
The .htaccess is a hidden text file that lets you control how visitors access your website. Common uses for the .htaccess file include redirecting URLs and/or restricting access to certain files. All right, let's explain you where to find this file.
Advertisement
Locate .htaccess
The .htaccess file is located in the root of your hosting. On a Linux server this area has the name public_html. On a Windows server it is called "httpdocs". You can reach this location using FTP, or the filemanager of a hosting like Cpanel or Plesk. If you are using Wordpress, the file can also be found using the backend of your Wordpress CMS (plugin).
1. Find .htaccess using Cpanel
My favorite and the best method for the .htaccess file being saved is to have a file manager displayed as a cpanel. Once logged into Cpanel, click on "Filemanager". In most cases, you will find it in the public_html, as it is not possible to click on "public_html" and quote it.
The .htaccess file is only visible if "show hidden files" has been marked/activated. In the upper right corner of the Filemanager click on "Settings" and mark it yourself if necessary. See screenshot below.
Now right click on the .htaccess file and click "Edit". Re-directs can be added below. See screenshot.
2. Find .htaccess using Wordpress
The easiest way to do this is to use a WordPress plugin. We are going to use the Htaccess File Editor plugin. This plugin allows you to edit the.htaccess file from your WordPress backend. It can be extremely convenient for those who are not comfortable with code.
Login to Wordpress, go to "Plugins" >> "Add new". There use the searchbox to search for "Htaccess File Editor". The plugin will show up in first place. Click the install button, and then activate the plugin. Go to "Settings" >> "Htaccess File Editor". To the right you will see the standard content of an .htaccess file when using Wordpress. Re-directs can be added below. See screenshot.
3. Find .htaccess using FTP
The most old fashioned but still working method is to use an FTP client like Filezilla. Open the Filezilla software on your PC or laptop, and login to your hostingaccount using FTP user and password.
Also with FTP you should be sure hidden files are being shown. This can be done like shown in the screenshot below.
All right, the .htaccess file will be in the list now within the public_html. Click on it with right and you will be able to edit it. Depending on the ftp-client maybe you have to download the file to your laptop and edit it there. Then re-upload it.
Advertisement