While moving a WordPress installation today to a new server I came across a weird situation involving permalinks. The new server was a Linux Ubuntu flavor running Lighttpd while the old one was a Windows 2008 running IIS. In order for friendly URLs and 404s to work properly, we had the following snippet added to the “lighttpd.conf” file (“mysite” is used as an example):

My custom permalink structure within WordPress was “/%postname%/”. After some testing I saw that everything was working fine, until I tried to edit a page in the admin section. That resulted in a page not found error. What was happening?

I thought I would then take a more careful look at the “lighttpd.conf” file just to verify that the rewrite module was installed and sure enough it was:

Do you see the issue? Hard to spot it is: the last item has a comma after it. Doubting if that was the issue, I removed the comma and restarted the Lighttpd service:

Sure enough, things started working fine in the admin as well.

The crazy part is that if the comma was causing issues like it was apparently, why did it seem to work in the first place for the public site?

One Response to WordPress friendly URLs/404s with Lighttpd and things that can go wrong

  • A Friend

    Mate, you’ve saved my day and made me laugh at the same time.

    Can you please “rewrite” the word before the end? LOL!

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.