How to create .htaccess file on Windows

If you install a wordpress blog on localhost using WampServer, you will need to create a .htaccess file in order to make your blog and its plugins working properly. But Windows will not allow you creating a file with named .htaccess. So how can we create .htaccess file on Windows?

How to creat .htaccess file on Windows localhostI’ve dealt with this problem when testing some wordpress plugins on localhost. First try I created a txt file, and then has it renamed to .htaccess, but Windows return an error message: “You must type a filename”. This means that Windows does not allow files with no name before dot (.) symbol. Then I tried these step to create .htaccess file on Windows:

  1. Creating a text file (.TXT) by right click → New → Text Documents, rename the file to a.htaccess
  2. Press Windows key + R to open Windows Run dialog
  3. Enter the command below to Run dialog and press Enter:
ren "C:\Users\asus\Desktop\a.htaccess" .htaccess

with “C:\Users\asus\Desktop\” is the path of a.htaccess file

The above command will rename the file a.htaccess to .htaccess

You’ve done. You will have a .htaccess file, simply copy it to wordpress blog directory, edit it with any text editors (you can use Notepad) and save it. Your wordpress blog and plugins will working properly with this .htaccess file

Please leave a comment below if you have faced with this problem and solved it.

Thank you very much.

3 Responses to “How to create .htaccess file on Windows”
  1. bgopal

Leave a Reply

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

CommentLuv badge