Creating Files With No Name

It doesn’t happen that often, but there are times when you might need to create a file without a name. One example is an .htaccess file. It’s a plain text file used on web servers to (generally) control access to certain directories. For example, most smaller web sites (like this one) are hosted on “shared servers”, that is, a server that hosts multiple web sites on one machine. To keep other (legitimate) users of the server from accessing my files, my web host uses an .htaccess file to restrict access to my files to anyone with my user name and password. Likewise, I use an .htaccess file in my own site to keep people without a username and password from accessing certain “storage” directories.

The problem with creating or editing such files in Windows is that Windows hates files without a “proper” name. Windows wants a file called “filename.extension” (like notes.txt) and it just chokes when you want to create a file without a name like (.htaccess). So if you need to edit your .htaccess file on a Windows computer (or, for that matter, any “hidden file” on a Unix system, like .config), Windows usually pitches a fit and demands that you give the file a name.

To get around this, simply put the file name in quotes when you go to save it. For instance, in Notepad you’d click File > Save, then choose “All files” and enter “.htaccess” as the name… aaaaannnd presto! One .htaccess file created in Windows, without the hassle!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.