nav-left cat-right
cat-right

How to create htaccess file on windows

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.

  • Open your favorite text editor program like Notepad.
  • Make sure “Word Wrap” is unchecked under “Format”.
  • Put your directives that you want to put or just leave it blank if you wish to add them later.
  • Go to “File” and click “Save As”.
  • When the save box pops up type .htaccess (don’t forget the dot) under “File name”.
  • Under “Save as type”, choose “All Files” and click “Save”.

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

If you just try to rename then you will get error

Make sure Word Wrap is not checked

Make sure Word Wrap is not checked

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

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

Choose the options as shown above

Choose the options as shown above

Right click or double click to open the file

Right click or double click to open the file

Choose to select a program

Choose to select a program

Open with Notepad or similar

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.



This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Leave a Reply