What are these htaccess files that keep popping up?

htaccess & Redirects | Updated 2026

If you keep finding .htaccess files appearing in your directories that you did not create, they are being generated by cPanel, your CMS (like WordPress or Joomla), or a security tool. These are normal and serve important purposes.

01. What Creates Them

  • cPanel - Password-protected directories, PHP handler settings, redirects, hotlink protection, index settings, and more
  • WordPress - Permalink settings (Settings > Permalinks) write rewrite rules to .htaccess
  • Security plugins - Wordfence, iThemes Security, and similar plugins add firewall rules to .htaccess
  • Caching plugins - WP Super Cache, W3 Total Cache, and LiteSpeed Cache add caching directives
  • Server security - Imunify360 and ModSecurity may add protective rules

02. Should You Delete Them?

Generally, no. Deleting .htaccess files can break your website's permalink structure, disable security features, remove password protection, and undo PHP configuration changes.

If you want to know what a specific .htaccess file does, open it in cPanel File Manager (make sure "Show Hidden Files" is enabled in Settings) and read the comments. Most auto-generated rules include comments explaining their purpose.

Important

Before editing or deleting any .htaccess file, make a backup copy. If something breaks, you can restore it. In cPanel File Manager, right-click the file and choose "Copy" to save a backup with a different name like .htaccess.bak.

For a comprehensive guide on what you can do with .htaccess, see Complete Guide to .htaccess on Apache. If you cannot see .htaccess files in your FTP client, see When I Upload an .htaccess File It Disappears.

Not Sure About an .htaccess File?

If you find .htaccess rules you do not recognize and want to know if they are safe, open a ticket and paste the contents.

Open a Support Ticket

Quick Recap

  1. .htaccess files are auto-generated by cPanel, WordPress, and plugins
  2. Do not delete them unless you understand what they do
  3. Back up before editing
  4. Enable "Show Hidden Files" in File Manager to see them
  5. Read the comments inside the file to understand the rules

Understanding .htaccess on your hosting account · Last updated March 2026 · Browse all htaccess articles

  • 496 Users Found This Useful

Was this answer helpful?

Related Articles

301 Redirect

Updated 2026 Quick Answer A 301 redirect permanently sends visitors and search engines...

Disable error_log via htaccess

htaccess & Redirects | Updated 2026 The error_log file in your public_html directory...

Nginx and htaccess Redirect Issues

htaccess & Redirects | Updated March 2026 If your .htaccess redirects aren't working for...

htaccess referral redirect

htaccess & Redirects | Updated 2026 You can use .htaccess to redirect visitors based on...

Show longer file names in directory/folder index

Updated 2026 Quick Answer To show longer file names in Apache's directory listing...



Save 30% on web hosting - Use coupon code Hosting30