So you’ve installed WordPress, imported your data and you’re ready to rock. Everything on the main page looks great. Your template is up, your posts are showing, your sidebar is filled with wonderful, non-cluttery widgets.
Then you click on a page link or post link and you get a horrible 404 page error. Crap. Your permalinks aren’t working.
If you’ve just installed WordPress, or moved your installation from one host to another, the problem may be your .htaccess file. You’ll need to locate your .htaccess file. As long as your host doesn’t restrict access to it, you should be able to access the file via FTP. I prefer to use FileZilla for this – just make sure you force the server to show hidden files.
The .htaccess file will be located at the root of your wordpress directory. So, if your blog is at http://yourdomain.com/blog, look in the “blog” directory – otherwise, just go to your domain root. Hint: the file will be located in the same director as your index.php. If you see index.php and no .htaccess file, it’s probably missing.
If you find the file, open it (and if you don’t, you’ll need to create your own by uploading a text file with the name 1.htaccess, then editing the name to remove the “1″ at the beginning and the “.txt” at the end). If you haven’t made any major edits to this file in the past (and, if you did, that might be why your permalinks aren’t working!) then let’s just keep it simple – delete what’s there and let’s start over.
Perishable Press provides a great start, providing the basic code for your WordPress .htaccess. Copy and paste the code here directly into that file, save, upload, and try your permalinks now. They should be working, if your .htaccess file was the problem.
If you know what you’re doing, or you’re willing to deal with the slight headache of starting over with your .htacess file if you screw it up, take a look at these tips for canonical URLS in WordPress, and Josiah Cole’s guide to the ultimate .htaccess file.





