How to Create .htaccess file on Windows

The .htaccess is a file that use to rewrite URL on a web server. It is the file that doesn’t has a name, only an extension. The problem comes when you want to create the file on Windows operating system. You can’t create a file without a name. If you try to create the .htaccess file, you will receive an error message: “You must type a file name”. The example below shows the error message when I tried to rename a file htaccess.txt to .htaccess.
You must type a file name

Solution to create .htaccess on Windows

There are some solutions to solve the problem above. The easiest one is to use notepad to create the .htaccess file.

  1. Open notepad and save the document with file name is .htaccess and save as type to All Files.
    Save as All Files
  2. The .htaccess file has been created.
    .htaccess on Windows

4 Comments

  1. Lien September 29, 2009
  2. Marcos Júnior Lopes February 22, 2012
  3. Mahesh September 7, 2012
  4. ima June 13, 2013

Leave a Reply