61924

LightTPD rewrite rules for Shinobu

— Frank — ? Comments

  • Update April 15th, 2009: Fixed a small bug in the rewrite rules. A 404 page was showed when a user logged in or out.

LightTPD rewrite rules for Shinobu 0.2. The only thing that's left are the rewrite rules for Nginx.

Just put the following rules in your config file and restart LightTPD.

url.rewrite-once = (
    "^/admin/themes/(.*)$" => "/admin/themes/$1",
    "^/admin/js/(.*)$" => "/admin/js/$1",
    "^/admin/?$" => "/admin/index.php",
    "^/admin/(.*)$" => "/admin/index.php?q=$1",
    "^/themes/(.*)$" => "/themes/$1",
    "^/?$" => "/index.php",
    "^/([^?](.*?))$" => "/index.php?q=$1"
)

Or if you got Shinobu in a subdirectory (replace subdir with the name of your subdirectory):

url.rewrite-once = (
    "^/subdir/admin/themes/(.*)$" => "/subdir/admin/themes/$1",
    "^/subdir/admin/js/(.*)$" => "/subdir/admin/js/$1",
    "^/subdir/admin/?$" => "/subdir/admin/index.php",
    "^/subdir/admin/(.*)$" => "/subdir/admin/index.php?q=$1",
    "^/subdir/themes/(.*)$" => "/subdir/themes/$1",
    "^/subdir/?$" => "/subdir/index.php",
    "^/subdir/([^?](.*?))$" => "/subdir/index.php?q=$1"
)

I haven't tested it thoroughly, but it should work. Post a message on the forum if it doesn't.

Share

Comments