Everyone at some time or another has had an issue with .htaccess and their WordPress installation. This typically has implications for the use of Permalinks, but it impacts other things as well.

This post is an attempt to make some things clear for users.

What are permalinks?

Permalinks are the URL’s created for each individual post. Typically, an application like WordPress creates that link this way: http://www.yoursite.com/?p=54 or something to that affect. It is not very pretty nor search engine friendly. Changing the permalink structure can create both pretty and search engine friendly links. For example: http://www.yoursite.com/mycategory/this-is-what-i-think

For more info see Using Permalinks on the WordPress Codex site.

Before employing pretty permalinks there are several questions to ask.

What version of Apache is the web host using? Apache is the web server used by many web host providers to “get” your web site onto the Internet. Typically this could be found in the administrative panel provided by your web host. A lot of providers use cPanel as the administrative tool. On mine, there is an Info Button. The Info page has a Versions and Paths link. Clicking that link displays the various services used by my web host and the version of each service. In my case, Apache’s version is 1.3.33. The navigation to this information may be different then what I described. If you need help, leave a comment or email me.

If Apache is anything less than version 2.0 OR you host does not use Apache, then you only have one choice for permalinks.: /index.php/ needs to be included as part of the permalink structure.

Example:
www.yoursite.com/index.php/this-is-what-i-think.

See the Options/Permalinks menu within WordPress for more info on setting this up. Though this method is considered a “hack”, it avoids having to deal with the .htaccess file.

If Apache is 2.0 or above, then you must determine whether the host has an Apache module called mod_rewrite installed on your server.

How do I find out if mod_rewrite is on my server?

Sometimes the administrative panel will have a button to access PHP info. If not, temporarily create a page named “test.php”. Add one line to this file:

php_info();

Upload the file to your website. Access the file through your browser: http://www.yoursite.com/test.php

The screen should display a white background with purple headings detailing the PHP installation. Look for the category labeled Apache. Under this category there should be a row labeled “Loaded Modules”. In the cell next to this label look to see if the mod_rewrite is listed. If it is, then it is installed.

If you have Apache 2.0 or higher and mod_rewrite is installed then you can use the method described below for the permalink structure, else you will have to use the solution above that uses /index.php/.

This method updated the .htaccess file. Starting with WordPress 1.5, WordPress automaticaly updates this file.

I have included two helpful posts from the WordPress support site that simplify the steps:

————————————————————————————————-
From viitoria:

Here’s what I did when I got just about every single problem posted on this page.

1) Make a .htaccess file, but leave it blank.
2) Upload it into the directory your WP index.php page is.
3) Change chmod of the .htaccess to 777
4) Update permalinks
5) Change chmod of .htaccess back to 644 (for your own protection)

It should work now. Hope this helps.
————————————————————————————————-

————————————————————————————————-
From Tim

I’ve struggled with this for a couple of days and finally got it to work using exactly the same steps as the poster above but with the addition of one step:

4b) edit the .htaccess file generated by wordpress and add the line Options +Followsymlinks so that the first three lines of this file now read:

<IfModule mod_rewrite.c>
Options +Followsymlinks
RewriteEngine On

(There’s no point adding this line before WP updates the .htaccess file: you addition will just be overwritten.)

This is assuming of course that Apache is configured to allow .htaccess files. You need AllowOverride to be set to All in your /etc/apache2/httpd.conf and .htaccess to be defined as the name of the file that can override the default settings. The section should look something like this:

<Directory />
Options None
AllowOverride All
Order deny,allow
Deny from all
</Directory>

# use .htaccess files for overriding,
AccessFileName .htaccess

Hope this helps someone

Tim
————————————————————————————————-

I should add that further instructions for implementing step 4 can be found at the Options/Permalinks menu within WordPress. There are many suggestions and opinions about the exact structure for permalinks. At the very least, include the post name. Another recommendation can be found here.

WordPress Resources To Help You

As a WordPress user you may be interested in learning more about the power of WordPress. The following resources will help you make your WordPress website superior to your competitors:

  • Digging into WordPress - Want to know more optimizing your WordPress website? Or key elements of WordPress Theme design? How about WordPress and SEO? This recommended ebook will give you a firm foundation of WordPress knowledge and practice. In clear, easy to read language, Digging into WordPress helps you understand the theory and the techniques for making your WordPress website remarkable!
  • WordPress 3 Essential Training - Over 5.5 hrs of video tutorials covering WordPress installation, post and page maintenance, self-hosting, plugins and more!
  • WordPress 101 Video Tutorials - 17 plus videos covering all the core elements of WordPress for $19. Absolutely best source of WordPress video tutorials for the beginner.
 

About the Author

Paul Flyer loves to research the web and find resources and tools for building, maintaining and promoting websites. Based in Saint Louis, MO, he works in management and spends his free time sharpening his web development and copy writing skills. Feel free to contact Paul with any questions, comments or ideas. He is also available to help you with your own website.