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

Trying to find your .htaccess file can be one of the most common frustrations when you start working on your WordPress site. You’re likely looking for it to fix a common error, but it seems to have vanished.

If this sounds familiar, then you’re in the right place.

The two most common reasons you can’t find your .htaccess file are that 1) it’s a hidden file and your file manager isn’t set to show hidden files, or 2) it hasn’t been generated by WordPress yet.

We’ve helped thousands of users solve this exact problem. And in this guide, we’ll show you exactly how to find your .htaccess file by making it visible, and how to create a new one if it’s missing.

Finding the .htaccess file for your WordPress site

Quick Answer: Why Can’t You Find Your .htaccess File?

Your .htaccess file is hidden by default — your FTP client or file manager needs to be set to show hidden files. If it’s still not there, WordPress may not have created it yet, which you can fix by saving your permalink settings.

What Is the .htaccess File?

The .htaccess file is a hidden server configuration file in your WordPress root folder that tells the Apache web server how to handle URLs, redirects, and access rules.

  • Controls your permalink structure — keeps post URLs clean and SEO-friendly
  • Apache servers only — if your host uses Nginx, this file won’t apply; check with your host

How to Find or Create Your .htaccess File

Here’s a quick overview of all the topics we’ll cover in this post.

You can use the quick links below to jump to different sections:

Method 1: Making Hidden Files Visible

The dot at the beginning of the .htaccess file name tells the server that it is a hidden file. By default, most FTP clients and web-based file managers do not show hidden files. This means that you need to change a setting to make them visible.

Here at WPBeginner, our developers often use FTP clients like FileZilla for server access. This is a reliable tool that gives you direct control over your website’s files.

How to Show Hidden Files in FileZilla
  1. Connect to your WordPress hosting server with FileZilla.
  2. Click on ‘Server’ in the top menu bar.
  3. Select ‘Force showing hidden files’ from the dropdown menu.
Show hidden files in FileZilla

Once you enable this option, you will be able to see the .htaccess file in the root directory of your WordPress website.

How to Show Hidden Files in cPanel / Bluehost

If you’re using the File Manager app in cPanel, you can find a similar setting.

First, log in to your hosting account. If you use a host like Bluehost, navigate to the ‘Websites’ tab, and click ‘Settings’ for your site.

Bluehost site settings

Next, you need to find and click on the ‘File Manager’ icon.

File Manager is a cPanel app that allows you to browse files stored on your hosting server without using an FTP client.

Accessing a website's file manager in Bluehost

Once the File Manager opens, click the ‘Settings’ button in the top-right corner.

A popup will appear. You need to check the box next to ‘Show Hidden Files (dotfiles)’.

Show hidden files in cPanel

Click on the ‘Save’ button to store your changes.

You should now be able to view and edit the .htaccess file in the File Manager app.

Method 2: Generating a New .htaccess File

The second reason for a missing .htaccess file is that your site hasn’t generated one yet. WordPress creates this file automatically to handle your permalinks, but sometimes it needs a little push.

First, log in to your WordPress dashboard and navigate to Settings » Permalinks.

Permalinks settings page

Don’t make any changes. Simply scroll to the bottom and click the ‘Save Changes’ button.

WordPress will now try to generate the .htaccess file for you. If it fails due to a file permissions issue, it will show you a message saying the ‘.htaccess file is not writeable’.

Manually Creating the .htaccess File

If WordPress cannot create the file automatically, you will need to do it manually.

Simply open a plain text editor like Notepad on your computer.

Copy and paste the standard WordPress rules below into the text file:

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

Note: If your WordPress site is installed in a subdirectory (like yourdomain.com/blog/), then you must change the RewriteBase / line to RewriteBase /blog/.

Important: Never add your own code between the # BEGIN WordPress and # END WordPress comments. WordPress overwrites this section whenever you update your permalink settings.

Now, save the file on your desktop as .htaccess. Make sure your text editor doesn’t add a .txt extension to the file name when you save it.

Next, connect to your website using an FTP client and upload the .htaccess file to your site’s root directory (usually /public_html).

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

What to Do If You Still Can’t Create or Edit .htaccess

In our experience managing hundreds of WordPress sites, we’ve occasionally seen server configurations or security plugins that prevent you from modifying the .htaccess file. This is usually done as a security measure.

If you’ve tried the troubleshooting tips above and still can’t get it to work, the best course of action is to contact your WordPress hosting provider’s support team. They have access to server logs and can quickly identify and fix the issue.

For more tips, see our guide on how to ask for WordPress support and get it.

Frequently Asked Questions About the .htaccess File

Where is the .htaccess file located in WordPress?

The .htaccess file is in the root directory of your WordPress installation — usually the public_html folder. Since it starts with a dot, it’s hidden by default. Enable “Show hidden files” in your FTP client or cPanel file manager to see it.

Does .htaccess work on all WordPress hosting?

No. The .htaccess file only works on Apache web servers. Most shared hosting plans (like Bluehost or SiteGround) run on Apache, but if your host uses Nginx, .htaccess won’t apply. When in doubt, ask your host.

What is the default code for a WordPress .htaccess file?

The standard WordPress .htaccess contains rewrite rules between # BEGIN WordPress and # END WordPress comments. The full code is shown in the Manually Creating section above. Many caching and SEO plugins add their own rules outside this block.

Is it safe to delete the .htaccess file?

Yes, deleting the .htaccess file is safe as a troubleshooting step. WordPress will recreate it when you go to Settings » Permalinks and click ‘Save Changes’. Deleting it removes custom plugin rules temporarily but won’t delete your content.

Can a plugin create or modify the .htaccess file?

Yes. Caching plugins like WP Rocket add browser caching rules, SEO plugins like All in One SEO may add sitemap rewrite rules, and security plugins like Wordfence can add bot-blocking rules — all in the .htaccess file.

Additional Resources for Troubleshooting WordPress

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 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.

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. 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.