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

    I used this guide to solved the issue of mistakenly deleted my htaccess file from Cpanel file manager.
    Thanks for the guide.
    Note: I have even cleared the trash files already, so couldn’t not restored the file but to create another on and this guide is useful.

  2. MarownIOM

    Thank you very much. Re-creating the .htaccess file from the Permalinks section worked.

    • WPBeginner Support

      Glad our guide was able to assist!

      Admin

  3. Shahbaz

    Thank you very much. This article is very helpful.

    • WPBeginner Support

      Glad our guide was helpful :)

      Admin

  4. Raafat

    Thank you. You saved my life. :)

    • WPBeginner Support

      You’re welcome, glad our guide was helpful :)

      Admin

  5. Syed Mehmood

    In my Cpanel there are so many .htaccess files so can i delete them or not?

    • WPBeginner Support

      If you have multiple with the same name for some reason, you may want to check with your hosting provider’s support in case it was set up for something specific to your hosting provider.

      Admin

  6. Jessica

    This worked perfectly, thank you!

    • WPBeginner Support

      You’re welcome :)

      Admin

  7. Amber

    I still can’t find the .htaccess file. I’m using a free WP site (so plugins aren’t available), and there’s no “permalinks” section in the admin for me to manually create the file. What should I do?
    Thanks!

  8. Thomas Jones

    After a php version update my site went down. The hosting company are no help at all. I read your blog and updated my permalinks file and all works fine now. Many thanks, Tom : )

    • WPBeginner Support

      Glad our recommendation was able to help :)

      Admin

  9. Thor Erik Just Olsen

    Thank you! Saved my day :D

    • WPBeginner Support

      Glad our guide could help :)

      Admin

  10. Urdesigno

    Thank you this artical is very help full

    • WPBeginner Support

      You’re welcome, glad our guide was helpful :)

      Admin

  11. Rafael

    Great! It was just hidden, in WinSCP

    • WPBeginner Support

      Glad our recommendation could help :)

      Admin

  12. pankaj

    Quite a Helpful article, thankyou. one question though do we really need .htaccess file as being an administrator?

    • WPBeginner Support

      Yes, your site should have an .htaccess file. It handles some things on your site and gives you more tools you can use.

      Admin

  13. Tammy

    This was so helpful, thank you!

    • WPBeginner Support

      You’re welcome, glad our guide was helpful :)

      Admin

  14. Dev

    Thanks so much! This solve my issues, i was about to get crazy, thanks!

    • WPBeginner Support

      You’re welcome, glad our guide could help :)

      Admin

  15. Michael

    Saved my day! Thanks

    • WPBeginner Support

      You’re welcome, glad our article could help :)

      Admin

  16. Arnold Alphonce

    Thanks that was really helpful. I did not save changes for the first time and also the permission as you said. Once i did that i worked fine thanks again

    • WPBeginner Support

      You’re welcome, glad we could be helpful :)

      Admin

  17. Arif Billah

    Thanks for the help, this blog helps me a lot, i had been working to resolve this for 3 days.

    in my case file name was not written, i have identified it with file type.

    100% beginner also not an IT guy. :)

    once again Thanks a lot

    • WPBeginner Support

      Glad our article could help yo fix the issue :)

      Admin

  18. Luke Cavanagh

    Also you may not be able to the find .htaccess file on the site server, since NGNIX is being used.

    • WPBeginner Support

      You are correct, that is another possibility but not always a common one :)

      Admin

  19. gurdeep

    hi. I tried to see if the file was hidden. This didn’t start showing .htaccess. I then went to permalinks and saved changes (even tried updating some settings and updating again) a few times. I didn’t get any text from WP. It just accepted the changes. I still can’t see the htaccess file.
    Not sure why this is happening. Can you please help.

    • WPBeginner Support

      You may want to check your hosting provider to see if they see the htaccess on their end.

      Admin

  20. sany

    hey there,
    I followed the instructions step by step, however I still cannot find the .htaccess -.-
    when I create one on my mac with text pad (or should I use word doc?) and try to paste it via ftp (filezilla) in the ” / ” folder but it still does’nt work.

    The links on my wordpress shows “404 Not Found nginx”

    please help!!

    • WPBeginner Support

      You may want to ensure you don’t have a file extension on the end of your .htaccess file as that is one of the more common reasons it does not work.

      Admin

    • mohit verma

      Go in WordPress and then click on settings and then select permalinks and then select plain and then save changes

  21. abhishek

    hey . i need your help regarding my cpanel . it shows only text and when i click on any tool it gets logged out. i have tried many ways to repair my cpanel but can’t resolved it . i m using cloudflare though.

    • WPBeginner Support

      Hi Abhishek,

      Please contact your hosting provider. They will be able to fix this issue for you.

      Admin

  22. Don Herman

    This probably worked once, but no longer. No message appears on the Permalinks page when you save it. Show Hidden Files in FileZilla doesn’t reveal the .htaccess file. Pretty much useless from the get-go.

    • WPBeginner Support

      Hi Don,

      It still works. .htaccess file is hidden by default. If you cannot see it in your FTP client, then please try a different FTP program.

      Admin

  23. Ted Fisher

    Very weird! Please help. I did find my .htaccess file and copied and pasted the code into it. Now all pages are secure except the home page. Any help would be appreciated.

    thanks,
    Ted

  24. gretchen

    :( I followed all the steps but I still don’t see an .htaccess file in my FTP. I didn’t see any message at the bottom of the page after I clicked “save changes” on my permalink page.

    • Petra

      I have the same problem.

      • Carolina

        I have the same problem. No .htaccess using CuteFTP (yes, I enabled filters) and the file manager in Plesk. Does this mean there isn’t one??? Please answer!!!

        • WPBeginner Support

          Hi Carolina,

          If your web hosting server is using a different software like Windows or Nginx then you may not be able ot find .htaccess file.

  25. Anj

    It helps a lot .. Thanks .. i can access again my website .

  26. Neil

    The htaccess rewrite worked! Thanks ever so much for your help. Brain is fried after a complete loss of dashboard today. I had to create a .htaccess file and upload it through ftp.

    Thanks again

    :)

  27. Kathy

    OMG thank you. I added this to my .htaccess file

    php_value upload_max_filesize 64M
    php_value post_max_size 64M
    php_value max_execution_time 300
    php_value max_input_time 300

    FTP wouldn’t let me overwrite .htaccess so I uploaded it as .htaccess-new then deleted .htaccess and renamed .htaccess-new to .htaccess

    Yay!

  28. Annie

    Hello,

    I am unable to select any of the code in the box to recreate my .htaccess file. It appears to be an image file only…

    Thanks.

  29. Emilio

    Thank you! You saved my day, I started to get worried I will not fix this. I appreciate it, honestly.

  30. Tony

    Can you please tell me how to keep WP back end log in longer time when i am on back end for uploading? because due to SSL, it automatically logs out of the account in some minutes and ask me to log in again. this is troublesome, thank you

    • Nadir

      I have the same problem! did you find a solution?
      please help.
      thanks

  31. Kay Collier

    The permalinks solution didn’t work for me either.

    In cPanel I have a page that will allow me to edit 403 (forbidden) but when I click on the code to edit I’m absolutely lost which is very annoying as I’m sure it must be easy to do, if only I knew how!

    Can anyone explain please?

    Sincerely

    Kay

  32. Axel

    Hi!

    I am new to wordpress and have set up my wordpress site this weekend. To ensure it is safe, I followed the htaccess/htpasswd settings today and all worked fine.

    After some hours, I could not access my wordpress site anymore but get the error message

    [Tue Nov 01 20:31:36 2016] [authn_file:error] [pid 26428] [client xxx.xxx.xx.xxx] [host xxx.xxx.de] AH01620: Could not open password file: /XXX.htpasswd

    How can I overcome this issue?

    thanks for any help!
    Axel

  33. juan luis

    You have a wonderful page. My only objection is that font sizes are too samall. I print everything I read

    • dt.k

      Why don’t you just zoom your browser window in to make the text larger?

  34. Jazib

    i don’t want to use ftp client method. Tell me how to edit htaccess file via cpanel

  35. lmahdi

    thanks

    it’s salve me

  36. Fahad Saleem

    Thanks it really helped.
    Keep sharing more wisdom.!

  37. Habib

    Really interesting and informative post. I like all posts of wpbeginner.com. nice website.

  38. Caspar

    Hey.. I played around with WP rocket and cleared my .htaccess – Now i am missing elements and sections of my webpage. I have tired to disable minifying. But still nothing happens.

    Really i have no idea of what made these sections disappear . Any one have an idea of what i should try?

  39. Olatuga Moses

    Is there any way or some how I can make my audio wp content downloading be available to all mobile device,like if I just upload audio to W-P it is only some specific device that would be able to download it with streaming online.like I need help on how to make my audio link download on all mobile device.

  40. Suzy

    Having tried the above I still can’t see my htacess file and I do not get the message saying not rewritable under permalinks. Can anybody help, I’ve been getting the 500 Internal Server Error for two days now and am desperate to update to the latest version of Wordpress. My site is slow and shows the message frequently. Any help would be gratefully appreciated.

  41. aditya

    WP Maximum Execution Time Exceeded.
    give it a try.
    its working now i get relief.
    thanks for your help.
    i really appreciate your work.
    thanks thanks thanks!!!

  42. Tan

    Thank you! You wake me up from the death!

  43. jackel

    Solved: Yesterday I started my second wp site, all went well until I noticed that all permalink options didn`t work except the default one, every time I changed to another permalink structure, I received the famous 404 error. I cross referanced with my first wp site, and noticed that the web.config file was not in the root. Obviously I copied and pasted the web.config file from my first site to my new site, refreshed and now all permalinks work fine.

  44. Talib

    dear can we use .htaccess Plugin by aubrey poortwood, is it bettter or not

  45. Miello

    thanks for this! Just ran into this and this helped me solve my issue.

  46. McGhori

    Thanks you so much Balkhi, Your information is brilliant Boss. Thanks again.

  47. Dave Naylor

    It’s worth pointing out that your .htaccess file might be missing because you don’t need one. For instance the Nginx web server doesn’t use .htaccess files for security and performance reasons.

  48. Pierre Gazzola

    Hope you do not intended to leave permission at 755 for the file or anyone would be able to hack your site via that file no ?

  49. Howard Lee Harkness

    I had occasion to look around for some redirection plugins for WP, and I noticed that some implement “hit counters.” I suspect all of them have to put something in the .htaccess file. I would love to see an article that goes into more depth on redirection, link cloaking, and hit counters.

  50. Kasa

    Isnt it easier co create .htacces right in cPanel (if you dont have it) rather than saving in notepad and uploading via ftp?
    I think that way is more easier and faster.

    • WPBeginner Support

      Kasa yes this should work too, however many users don’t have access to cPanel. Some webhosts use their own hosting control panels.

      Admin

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.