“Where is my .htaccess file?”
This is a problem that we’ve helped resolve over and over again at OSTraining.
The .htaccess file is absolutely crucial for the correct operation of many sites, whether they’re running WordPress, Drupal, Joomla or similar platforms. The .htaccess file controls the URLs for sites and also adds many important security features.
Today, one more user was having trouble finding their .htaccess file, so we created this tutorial for her.
Step #1. Access cPanel’s File Manager
- Go to yourdomain.com/cpanel and log in.
If you’re not sure of the login information, look for the first emails from your hosting company. They’ll provide the cPanel information within there.
- In the Files section, look for the “File Manager” icon. Click on it.
- Select “Web Root”
- Select “Show Hidden Files (dotfiles)”
If you don’t receive this popup asking you to “Show Hidden Files (dotfiles)”, it’s because you’ve selected “Skip this question” previously.
If you don’t see the .htaccess file (or any dotfiles) in File Manager, scroll to the bottom of cPanel. Then click on “Reset All Interface Settings”. Afterward, clicking on “File Manager” should get you the popup.
Step #2. Find the .htaccess File
Once in File Manager, you should be able to find the .htaccess file on that page. If not, navigate to your site’s root. So if your site is in a subfolder, go to that subfolder and you should see the .htaccess in there.
Also, note that some sites won’t have a .htaccess and it will need to be created. For example, when Joomla sites are first installed, they come with a sample htaccess.txt. That then needs to be renamed to .htaccess.
Don’t have cPanel?
If you don’t have cPanel in your hosting, please give your host’s file manager a try or use FTP. Our Absolute Beginner’s Guide to FileZilla will help you get started with FTP.
If you’re on localhost, there’s usually not a need to use your .htaccess file. I’d recommend waiting to use it until you move to your production server instead.