Wordpress Pretty Permalinks on Lighttpd
At some point in your Wordpress-life, you need a pretty permalink (name of the link at the navigation bar). On Apache we can easily use the rewrite module (mod_rewrite) which works pretty well. On the other hand, I found it confusing to make the equivalent rewrite rule on Lighttpd, therefore I use the other module called magnet module (mod_magnet) instead. And these are some simple steps how to use it:
Install Magnet Module
Simply install it from the default repositories.
Dont forget to enable the module:
Lighttpd Configuration
Edit the configuration file:
If you do not use vhosts, add the following to the end of the file:
If you do use vhosts, add that line to your vhost instead:
server.document-root = "/var/www/example.com"
magnet.attract-physical-path-to = ( server.document-root + "/rewrite.lua" )
}
Where example.com is the name of your website and /var/www/example.com is the directory where your website is.
Make a Lua script, assuming that Lua is supported by default (I didn't have to install anything at that time):
Again, don't forget change /var/www/example.com to your own setting.
Add the following Lua script into the file, thanks to Sudhaker.
if (not attr) then
lighty.env["uri.path"] = "/index.php"
lighty.env["physical.rel-path"] = lighty.env["uri.path"]
lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"]
end
Reload the module:
Now visit your Wordpress's permalinks configuration, http://example.com/wp-admin/options-permalink.php and use the default or follow this guide. Enjoy!
Hello world!
Welcome to the wordpress version of Longspine.com! I also moved to a new server. These are some notes about this website:
- Xen-based VPS with 512 MB RAM at prgmr.com
- the new host is in US, so all accesses from Europe will be a lot slower, however, it's faster for people in Thailand.
- Wordpress 2.8.4 was installed
- CodeColorer
1print "Hello, World!"
- WP QuickLaTeX 2.5.2

All posts from the Drupal version shall be all imported, by hand! There are not so many though, thanks to my laziness.