Couldn’t You Find Your .htaccess File? Create a New One

How To Create A New .htaccess File

When you use self-hosted WordPress platform then there are many things to know for managing your website. WordPress is the boss and it can alter many files according to its own.

Most of the beginners get scared when they get any error message or can’t find any particular file.

In this tutorial, I am going to show you how to create a new .htaccess file? when you can’t find it in your root directory. You may have heard about the name of this file. I am sure you have dealt with it many times.

How To Create A New .htaccess File For Your Website?

Before going further, you should know something about this file. You can easily find this simple file in your “public_html” directory. It tells the server about many things to handle at your website.

It guides the server how to redirect users, how to handle them, how to protect your admin area and more.

You may have noticed that some bloggers suggest you to delete your .htaccess file to remove 500 error and other errors. But what after that? How will you create a new .htaccess file?

I am going to give the answer of this question for you. I know newbies don’t really feel good with these techie things, but you know you can generate .htacces file within few seconds.

First thing if you have the backup of your website then you can find the file in that zip file. You can copy the file and upload it in the directory. As you, all know that it is always recommended that you should have the backup of your website and database.

In case, you don’t have the backup then another way to generate .htaccess file is very simple.

Step 1: The first thing is to login into your wp-admin area of WordPress.

Step 2: Now go to settings>>permalinks and a new page will open for you. There are many options to choose. WordPress will add default permalinks for your website. You can change them if you want.

create a new .htaccess file

Step 3: Now is the final step to create a new .htaccess file for your website. You just need to save the default option or the option you have chosen before, and save it.

generate .htaccess file

You have successfully created a new .htaccess file. You can check it in the directory of your website. Just go to cPanel>>files and you can find .htaccess. Make sure that you enable to show the hidden files. The dot before the .htaccess shows that it is a hidden file.

You can change the permalinks according to you. Just select the option and click the save button. Every time you save the permalinks, .htaccess file will be updated.

Just follow the tutorial and you will see a new .htaccess file in the directory of your website. Don’t get panic when you don’t find this file. You can see above that its’ very easy to generate the .htaccess file.

Create A New .htaccess  File: Have You Created?

Have you created a new .htaccess file? Have you found the .htaccess file in the directory of your website? If you still don’t see any file with this name then check if you have enabled to show hidden files.

The final solution is to check the permissions. You should enable to read and write the files of the directory by the administrator. Make sure that you have allowed to see the files of the directory by yourself. If you still can’t find the .htaccess file then you should talk to your web hosting company. they will do something for you.

If you still can’t find the .htaccess file then you should talk to your web hosting company. they will do something for you.

I hope the tutorial was useful for you. If you still face any problem then feel free to ask anything you want. I will be happy to help.

You can also connect with us on Twitter, LinkedIn, and Facebook.

by Ravi Chahar

A blogger, web developer, and designer who intends to guide his readers about WordPress, Blogging, Web Development, Web Design and more. I have expertise in WordPress theme development and customization. I can set up and redesign the Thesis themes. I have been working in this field for years now.

12 comments

  1. Hello Ravi,

    Wonderful guide!

    I mess around much on the server and most-messing file is definitely .htaccess file. 🙂

    It is the epicenter of the files to check in case any issue(s) is hit on the server. It is almost the first file anyone with server-knowledge recommends to check in order to fix the issue.

    You provided method is one good way to create the .htaccess file itself, so you have right entries up there if you don’t know or want to be safe to create it manually.

    Good one I got it from Aha-Now ABC community! I am happy to share it! 🙂

    See me often!

    ~ Adeel
    Adeel Sami recently posted…Vote: Do You Use Your Own Links into RepliesMy Profile

    1. Hi Adeel,

      I am glad that you found this tutorial useful.:)

      I agree with you. Most of the time when you do any changes in your website then the .htaccess file get updated. There are chances that it may get damaged or may get disappeared.

      It is necessary that you should know how to create a new one? These type of small things matter a lot for your website. I am sure you are going to keep an eye.

      Thanks for stopping by.
      Have a lovely day.
      ~Ravi

  2. Hi Ravi,

    When ever i found help regarding WordPress then one blog which comes in my mind i.e. Blogginglove. Know doubt you have shared useful stuff which help out bloggers in blogging.

    This time you come up with another awesome topic with the help of this tutorial one can nicely deal with .htaccess file.

    Thanks for fantastic share once again 🙂

    Regard

    Mairaj

    1. Hey Mairaj,

      It’s so kind of you to say this.:)

      I just try to help people who are in need to know more about WordPress. These kinds of little techie thing can scare many bloggers. there is always a way to solve a problem. Here are the solutions.

      It is always good to see you at my blog.
      Thanks for your support.
      Have a great weekend.
      ~Ravi

  3. Already aware about .htaccess, thanks for explaining. Only if you could write one more article for explaining what all these permissions are.

    1. Hey Taposh,

      You know it’s very important to know about such type of files. When we talk about permissions then for sure I will write another post about it so that you can learn more.
      Thanks for stopping by.

      Have a nice day.
      ~Ravi

  4. Hello Ravi,
    Honestly this was like a new world for me, unable to understand any thing and After reading the title I did a cpanel login and search for .htaccess unfortunately I was unable to find, still am a complete newbie and just started my Blogging Career I got curious.

    Instead of Creating by my own, I open a Support chat with my Hosting Account Provider and they said it’s their after a conversation, they told me you need to mark “Show Hidden Files” to see the .htaccess file.

    I think this is something we should know, Just purchased a $1 hosting plan from hostmantis to learn cpanel without any fear of loosing my site.
    Can you please share a New Article on How to Take backup and Restore site from one host to another, if this can be done via any free plugin that would be awesome.

    1. Hey Ashok,

      It’s always good to know someone who is willing to grab about WordPress and the cPanel.
      Yeah, if you want to see hidden files then you have to click at “show hidden files”. The dot before .htaccess shows that it is a hidden file.

      For beginners, it is hard to handle the website using cPanel. I know using a plugin is an easy thing. But I always recommend the cPanel because once you get aware of it then you will never face any problem in the future.

      I have already written the article about the backup of your website and transfer it to another host. You can search it from the search box. You can use BackupBuddy, BackUpWordPress and many other plugins to backup your website.

      Thanks for being here and sharing your thoughts.
      Have a great week ahead.
      ~Ravi

  5. Hello,

    Great Post!
    I just got your blog link from “Enstine Muki”, seems like theirs much happening and a lot of bloggers to interact with. I loved you blog and will be sharing it with my circle.

    I’m a writer at Naman’s Board. Naman Board is a hub for English writings including science fiction, poems, quotes, essay on Life, Motivation, Inspirational.

    Hope to see you there!

    Happy Blogging!

    1. Hey Naman,

      Welcome to my blog.:)

      I am glad to know that you are trying to interact with more and more people. For a better blogger, writer, you have to connect with as many people you can. Enstine is an amazing blogger, developer and much more. You will learn a lot from him.

      It would be great to know you better through your blog.
      Thanks for being here.

      Have a great day.
      ~Ravi

  6. Hey Ravi Chahar,
    First of all I would like to appreciate your style of writing.
    I have found a problem I did not find the .hacc… file anywhere and created one according to your guide can you guide me where to put it?

    I am waiting for your kind reply

    1. Hey Fahad,

      You have to go to your cPanel and you will find the .htaccess file along with all other WordPress files and folders. If you have added your website in the main root directory then just open the file manager and search the file.
      ~Ravi

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge