For whatever reason, if you need to create a .htaccess file for your Apache or any other web server in a windows environment then here is the step-by-step guide. There are few ways to create a .htaccess file but here I will try to show you one of the easiest and quickest ways.
If you just try to rename a text file to .htaccess then you will get an error saying “you must type a file name”. Instead follow the steps below.
You’re done. Now, if you want to open the file and edit it, just find the file and open by selecting a program, for example notepad. Once you’re done editing just click “Save”.

If you just try to rename then you will get error

Make sure Word Wrap is not checked

Leave blank to edit later or just place your code and click save as

Choose the options as shown above

Right click or double click to open the file

Choose to select a program

Open with Notepad or similar
When you upload the file to your web server, make sure you upload in ASCII mode. I will write more on how to take advantage of .htaccess file in my future posts. In the meantime if you want to learn more about .htaccess then htaccesstools.com is a good read.
© 2009, Ricepan.com. All rights reserved. You may not republish this full article without permission under any circumstance.