Nothing is more frustrating for a fledgling designer than a 404 error on a newly created blog. The experience quickly causes the euphoric feeling of mastering basic web principles to plummet to earth faster than a 747 colliding with a flock of geese.
This happened to me last week. The homepage looked exactly as expected, but trying to view individual posts or pages returned an error. In examining my permalink settings, WordPress indicated that the issue lay with my .htaccess file (or, in the case of the image below, Kathy’s .htaccess file):
.Htaccess stands for hyper text access; the dot at the beginning of the name indicates that the files are hidden in Unix-like systems (Mac OS’s, etc). So, while they will appear in your FTP (if you’ve enabled dot files to be seen), they are otherwise undetected. .Htaccess files are read by the server, not the browser– enabling the browser to read them can compromise security.
According to a tutorial on the Apache site (fitting, since .htaccess is part of the Apache system), .htacess files “provide a way to make configuration changes on a per-directory basis.” Again– huh?
In plain(ish) English, these files work with the server to override certain settings, most often security settings or turning complicated URLs to more memorable (“pretty”) ones. This is why .htaccess most causes trouble in WordPress with permalinks— my experience exactly.
.Htaccess files are created in text editors; “.htaccess” is both the name of the file and the file extension. To create an .htaccess file, simply type the necessary code into the text editor, then change the file extension from .txt to just .htaccess and drag it into your root directory.
So where can you find an .htaccess file? According to WordPress Codex’s article “Using Permalinks,”
WordPress’s index.php and .htaccess files should be together in the directory indicated by the Blog address (URI) setting on your General Options page. Since the name of the file begins with a dot, the file may not be visible through an FTP client unless you change the preferences of the FTP tool to show all files, including the hidden files.
After a thorough search of all my folders in my other, fully-functional, non-doctored blog, and an examination of my FTP settings, I couldn’t find my .htaccess file. They remind me of koalas or salamanders: seemingly insignificant, rarely-seen creatures that never-the-less will totally screw up an ecosystem when removed.
If all of this makes complete sense and you’re interested in creating a more robust .htaccess file for your site (and know more about coding than I do), this guy has a tutorial. Otherwise, hope you’re not too confused.