Fixing non working Permalinks on WordPress

After struggling almost one week to find the cause for my not entirely working Permalinks on this WordPress installation, I finally found the cure on the WordPress Codex. I already read this page about five times and I just can’t tell how this one paragraph could always slip away… anyway the solution is rather simple.

As I’m a decently paranoid Server Admin I once changed the way Apache reports it’s server software. This poses some troubles with WordPress which checks to see if the host is running Apache or IIS to determine wether to write a .htaccess file with some mod_rewrite rules or not. As WordPress can’t find out on it’s own on my host I just had to help it a little 😉

In wp-includes/vars.php on line 40 is the check for the hosting webserver, I changed the entire line to read

$is_apache = 1;

After this small modification Worpress happily updatet the .htaccess file with the apropriate mod_rewrite rules (given the file permissions are correct on the server).

One small sidenote: If you are using FAlbum and have “friendly urls” enabled you have to make sure that the rewrite rules made by FAlbum are above the ones from WordPress.


  1. I’m finding the same problem you described but I dont seem to be able to fix it. I’m working with WP 2.0.2 and FAlbum 0.6.5 and I have the “friendly” permalinks on. I added the FAlbum rewrite rules before the permalinks one, but still, if I type /photos I get a 404 page. Any ideas?

  2. Hi Florian, thanks for your suggestion. I don’t think I’ve setted the ???AllowOverride all???. Could you please let me know how to do this?

  3. Sorry for the late reply!

    The “AllowOverride All” must be set in the config file of your webserver (this particular directive only applies to the Apache webserver as far as I know). It enables you to use .htaccess files which extend the options set for your virtual host. The .htaccess file that comes with WordPress has all the necessary options for friendly URLs.

    Do the other friendly URLs in your WordPress install function, or are they broken as well? I can’t really pinpoint where the error may lie on your side it could either be a general mod_rewrite problem or a problem with the inclusion of FAlbum. You might want to investigate further on those two options.

  4. Thanks Florian. The “AllowOverride All” should be set in the Apache since I’m able to use a .htaccess file for the permalinks. The problem I think is with the FAlbum. Even when I don’t use FAlbum “friendly” URL, I still get a 404 when I try to see the album page. I’m now doing more research to see if someone else found this problem.

Leave a Reply

Your email address will not be published. Required fields are marked *

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