Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

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

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
Why You Can’t Find .htaccess File on Your WordPress Site

Recently, we advised a user to delete .htaccess file from their site to solve a common WordPress error. The user was unable to find their .htaccess file and thought that there was something wrong with his website. For beginners, things like this can be very confusing. In this article, we will show why you can’t find .htaccess file on your WordPress site, and how to create one when needed.

What is .htaccess file?

.htaccess file is a server configuration file which tells your server how to handle certain things on your website. Like how to redirect users, password protect admin area, or protect some directories, etc.

The dot before the file name indicates that it is a hidden file. When you are accessing your web server through FTP, you will not be able to see .htaccess file unless your FTP client is forced to show hidden files.

Force showing hidden files in Filezilla FTP client

Sometimes even when you have forced your FTP client to show hidden files, it will still not show you .htaccess file.

Why You Can’t Find .htaccess File?

The most common reason for this is that your WordPress site has not generated a .htaccess file yet. WordPress generates .htaccess file for the first time when you set up pretty permalinks on Settings » Permalinks screen. All you need to do is to click on Save Changes button on the permalinks screen and WordPress will generate a .htaccess file in your site’s root directory.

Permalinks Settings Screen

On some rare occasion, WordPress may not be able to generate a .htaccess file for your website due to file permissions issue. In that case, WordPress will show you a notice at the bottom of the Settings » Permalinks screen, informing you that .htaccess file is not writable. If you have setup permalinks to use any other settings than default, then it will also show you the code you need to paste in your .htaccess file.

WordPress showing notification that .htaccess file is not writeable

You will need to copy and paste this code in a text editor like Notepad. After that you need to save it as .htaccess file on your desktop. Now connect to your website using an FTP client and upload .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 reside under /home/syedbalkhi/public_html/ directory.

This makes public_html folder your root directory. You need to go to its parent directory and right click on the public_html folder. Select File Permissions, which will open a file permissions dialog box. You need to enter 755 into the file permission dialog box and then try to upload your .htaccess file to public_html folder.

Changing file permission for root directory

We hope this article helped you find or generate .htaccess file on your WordPress site. If you are just starting out with WordPress don’t forget to check out Beginners Guides section, it has tutorials specifically written for new WordPress users. Let us know if you have any more questions or feedback in your comments below.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. juan luis says:

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

  2. Jazib says:

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

  3. lmahdi says:


    it’s salve me

  4. Fahad Saleem says:

    Thanks it really helped.
    Keep sharing more wisdom.!

  5. Habib says:

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

  6. Caspar says:

    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?

  7. Olatuga Moses says:

    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 I need help on how to make my audio link download on all mobile device.

  8. Suzy says:

    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.

  9. aditya says:

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

  10. Tan says:

    Thank you! You wake me up from the death!

  11. jackel says:

    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.

  12. Talib says:

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

  13. Miello says:

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

  14. McGhori says:

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

  15. Dave Naylor says:

    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.

  16. Pierre Gazzola says:

    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 ?

  17. Howard Lee Harkness says:

    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.

  18. Kasa says:

    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 says:

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

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.