As you can see this blog is powered on lighttpd web server platform. Lighttpd is very fast when compared with apache for static content delivery. But wordpress is not all static but there is slight performance improvement over apache and very lower memory usage can survive digg effect.
But with lighttpd biggest problem is you cant use smartass permalinks on wordpress like me. Ex- www.ruchirablog.com/post-title instead of www.ruchirablog.com/p=44
If you are smart in linux and compilations of server ware this might be simple problem to you. But for average users like us this is a really messy questions.
Lets get to the topic,
Setting up lighttpd is very easy like apache with kloxo search this blog for “installing kloxo” for kloxo installation guide. Kloxo will install both lighttpd and apache in default and you can switch between them on single click.
IF you are using kloxo as your server management tool keep noticed that your kloxo installation doesnt include lighttpd mod_magnet to use permalinks with easy. Integrating mod_magnet will be difficult because kloxo platform is bit complex and its having some issues when installing like normal.
So forget permalinks with mod_magnet even you are with kloxo or other setup of lighttpd.There is much easier way of using all kinds of permalinks in just single line of mod in lighttpd.conf file.
Just fire up your SSH client (PUTTY)
Enter to your server by using root privileges.
Then you need to find and edit lighttpd.conf file on your server. If you dont know where is lighttpd.conf file type
Whereis lighttpd.conf
It will display the path to lighttpd.conf file

Then fireup your favorite text editor ( my favorite is NANO to install nano type “Yum install nano” on SSH )
then open lighttpd.conf with NANO. Command for this on kloxo setup is “nano /etc/lighttpd/lighttpd.conf”
Then add this simple line to your lighttpd.conf file.
server.error-handler-404 = "/index.php"
This one line support for all structures of permalinks. No matter what it is.
This is it one simple line does it all instead of crazy mod_magnets
But please note that plugin WP-Super-Cache will not work with this mod. it needs mod_magnet but you can use WP-Cache or Hyper-cache plugins as you caching plugin. I personally use Hyper-Cache but ill test WP-Cache later too.
Last 5 posts by Ruchira
- WordPress blog got hacked? Part 1 What are the common mistakes you make! - January 2nd, 2012
- LNMP V0.8 The complete Nginx auto installer! - January 1st, 2012
- Opera and yandex reports my blog as phishing site! - December 31st, 2011
- My social experiment goes live! - December 28th, 2011
- Happy Holidays and Merry Christmas :) - December 21st, 2011
{ 15 comments… read them below or add one }
Hmm for some reason it didn’t work for me. I’m getting a 404 error.
my WP Permalink Structure is like this,
/%post_id%/%category%/%postname%.html
and I added this like to lighttpd.conf file using Nano,
server.error-handler-404 = “/index.php”
Did you reloaded the lighttpd after adding the server error handler?
Well I did restart the VPS. That should do it, right ?
Your permalink structure looks wrong to me! Can you try this structure in custom structure mode?
/%postname%/
And let me know if it works or not!
Didn’t work. same error. it shows right url but a 404 error.
I have used that custom structure for over 2 years now in various blogs. Haven’t had a problem.
everything looks normal than .html at last! try this if you like http://www.ruchirablog.com/nginx-autoinstaller/ very is too use permalinks with+ nginx performance! this blog runs on it too!
Okey I ll give it a try !
Here’s the line have added conf file using nano. Is this correct ?
http://img375.imageshack.us/img375/4792/nano0.jpg
(nginx means I have to rebuild the vps which I can’t do for a while ^^)
its correct! Can you try this
server.error-handler-404 = "/index.php?error=404"After adding restart vps and tell me!
Thanks
Hi.
You’re the smartest on earth
You saved my time and work and nerves
Thank you.
ooops thanks
Yes those problems sometimes drives me nuts too!
thanks it works but now im facing another problem with ‘search’..when i search for something which has more than 1 page the second page goes to second page of the site and not the second page of results..if i put the default permalinks it works fine but when i add the custom permalink it doesnt work
any ideas?
are you using wp-pagenavi plugin?
yes but in another theme im using wp-numbers still the same prob but im not sure for this…but on current theme its pagenavi
any help regarding my problem?