A Stupid .htaccess Tip for Windows

Microsoft operating/file systems will neither create nor allow files without a prefix, so the common suggestion when doing multi-platform web development (in that the majority of web hosting is done on Linux boxen) is to create a file called “htaccess.txt”, then rename it to “.htaccess” once you’ve uploaded it to your server. That’s all well and good, but there’s an easier way that avoids two inherent hassles.

1 With a graphical ftp client, you have to find the file, then delete the “.txt” at the end of the file name and then add the “.” at the beginning. This entails some vague degree of paying attention. The directory contents will then reorder to place .htaccess at or near the top (depending on what you name your files).

2 If you’re doing any amount of testing and changing .htaccess, you have to remember that in the local directory structure, it’s alphabetized under “h”, but at the top of the list – where you can pick it out at a glance – under *nix systems.

2a If you’re revisiting the code for a site you haven’t looked at in a good long while, you have to remember to scan through the file list and see if there’s an “htaccess.txt” lurking about.

The better mousetrap is to name the file “_.htaccess”. The file will appear at the top of the directory structure – making it obvious that it’s present – and all you have to do to rename it in your graphical ftp client is hit f2, “home” and “delete”.