Creating a .htaccess file in Windows
How many times has this happened to you?
- File->New->Text Document.
- Change from “New Text Document.txt” to “.htaccess”.
- Windows: “You must type a file name.”
- Hit F2 to rename.
- Change from “New Text Document.txt” to “.htaccess”.
- Windows: “You must type a file name.”
That’s right– Windows won’t let you create a file starting with a period. Fret no more!
- Open Notepad, Vim, or whatever you like. Create a new document.
- Save as .htaccess.
- Hooray! Other programs are not subject to explorer’s restrictions.

February 18th, 2007 at 1:10 am
Holy cow! Somebody actually uses explorer to create empty files? Really?
The intention:
Right Click. Find the New Menu. Find the Text Document. Click it. See icon randomly appear on desktop wanting to be named. Rename it. Hit enter. Double click it to enter. Write some text. Hit save. Hit Exit. (or hit exit and say “yes, I did want to save it”)
The alternative:
Open notepad. Write some text. Hit save. Type a file name. Hit enter. Hit exit.
The first is supposed to be a shortcut or something?
February 18th, 2007 at 4:16 am
Well, I actually use folder view, not Explorer. Same issues.
With folder view, I’m already in the correct folder. File->New->type name. Context menu button->open with Vim.
Normal action is: Ctrl->whatever to launch vim. Type some crap. :w partofdirectory-tabcomplete-partofdirectory-tabcomplete-partofdirectory-tab tab tab– and so on.
Basically, I’ve usually already got a folder view open to the folder I want to create .htaccess in, so it saves me the hassle of navigating yet again to the correct folder. I generally use pretty deep directory structures (ugh), and I haven’t rigged up any scripts vim-side to set default directories up for new buffers.