Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Why You Can’t Find .htaccess File on Your WordPress Site

One of the most common questions we get asked by beginners is, ‘Where is my .htaccess file?’ Not being able to find it can be frustrating, as you may need to edit or delete it to fix common WordPress errors.

The .htaccess file plays a crucial role in managing various aspects of your website, from permalinks to security settings.

In this article, we will explain why you can’t find the .htaccess file on your WordPress site and show you how to locate it.

Finding the .htaccess file for your WordPress site

What Is the .htaccess File?

The .htaccess file is a server configuration file that tells your server how to handle certain tasks on your website.

Some tasks this PHP file can handle include managing permanent links, redirecting users, password-protecting the admin area, and more. Think of it as an instruction manual for your web server.

The standard .htaccess file location is in the WordPress.org site’s root folder.

Why Can’t I See My .htaccess File?

If you can’t see your .htaccess file, it’s most likely because it may be hidden by your FTP or file manager. Or it doesn’t exist, and you may need to refresh your permalink settings.

We will explain both of these scenarios with solutions to locate the file. Feel free to use these quick links to skip to a specific scenario:

👨‍🔧 Need help maintaining your WordPress website? WPBeginner Pro Services offer solutions for you to keep your website safe and optimized, from WordPress maintenance and hacked site repair to emergency support.

Feel free to book an appointment with our team today to see what solution is best for your website!

Scenario 1: Your FTP or File Manager Is Not Showing Hidden Files

The dot before the .htaccess file name indicates that it is a hidden file. By default, when you connect to your WordPress hosting server using an FTP client, it will not show the hidden files.

To make hidden files visible, you will need to change your FTP settings.

In FileZilla, you can find this option by clicking on the ‘Server’ menu item and then selecting ‘Force showing hidden files’.

Show hidden files in FileZilla

For other FTP clients, you will find the option to show hidden files in the app settings or preferences menu. After enabling this option, you will be able to view all hidden files, including the .htaccess file for your WordPress website.

To those using the cPanel File Manager app, you will find the option to show hidden files.

If you use Bluehost, you can simply go to the ‘Websites’ tab and click on the ‘Settings’ button on the website you want to edit.

Bluehost site settings

Next, scroll down the page.

Then, click on the ‘File Manager’ button.

Accessing a website's file manager in Bluehost

Here, you can click on the ‘Settings’ button in the top-right corner.

After that, go ahead and enable the ‘Show Hidden Files’ option.

Show hidden files in cPanel

Scenario 2: The .htaccess File Doesn’t Exist

The second most common reason for a missing .htaccess file is that your WordPress site has not generated it yet.

WordPress automatically generates a .htaccess file because it is required to properly redirect permalinks.

If your .htaccess file is missing, then the first thing you need to do is to visit Settings » Permalinks from your WordPress dashboard. Then, click on the ‘Save Changes’ button without changing the permalink structure settings.

Permalinks settings page

WordPress will now try to generate the .htaccess file for you.

In some cases, WordPress may not be able to generate the .htaccess file due to a file permissions issue. If that’s the case, it will show you a message at the bottom of the Settings » Permalinks page saying that the ‘.htaccess file is not writeable’.

htaccess file not writeable

You must manually create a new .htaccess file and add the following code snippet inside it:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mysite/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

Simply copy and paste this code into a text editor like Notepad. After that, you need to save it as a .htaccess file on your desktop.

Now, connect to your website using an FTP client and upload the .htaccess file from your desktop.

If you get an error while uploading the file, then you need to change the file permission for your root directory.

Let’s suppose all your WordPress files are under /home/johnsmith/public_html/. This makes the public_html folder your root directory. You need to go to its parent directory and right-click on the public_html folder.

Next, select ‘File Permissions’, which will open a file permissions dialog box.

You need to enter ‘755’ into the ‘Numeric value’ box and then try to upload your .htaccess file to the public_html folder.

Changing file permissions via FTP

And that’s it! If you’re curious about .htaccess, you can learn more about it in our article on the most useful .htaccess tricks for WordPress.

Note: Once you have found your .htaccess file, then we suggest creating a backup of your WordPress site first before editing it. Incorrect edits can cause website functionality issues.

What to Do If You Cannot Create or Edit .htaccess

In some situations, you might encounter issues creating or editing the .htaccess file on your WordPress site.

For example, your web server’s configuration might restrict editing certain files, including the .htaccess file. In rare cases, a plugin might even interfere with your ability to manage the .htaccess file.

If you’ve tried the troubleshooting tips mentioned and still can’t create or edit the .htaccess file, then the best course of action is to contact your WordPress hosting provider’s support team.

You can read our guide on how to ask for WordPress support and get it for more information.

Learn More Ways to Troubleshoot WordPress

Are you experiencing other WordPress errors? Check out these guides to solve the problem:

We hope this article has helped you find the .htaccess file on your WordPress site. You may also want to see our WordPress troubleshooting guide to fix common WordPress errors and our list of the best WordPress plugins to grow your website.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here's our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!

Reader Interactions

81 CommentsLeave a Reply

  1. Jiří Vaněk

    Thank you for the advice. It helped me not only solve the issue with the htaccess file, which I encountered for the first time (on other servers I saw the file without any issues), but it also helped me solve the problem with the .user.ini file, where I needed to place directives for PHP limits. I didn’t know these files are hidden by default.

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.