Page 1 of 1

Installation on lighttpd with rewrite support

Posted: Sat Dec 10, 2005 2:33 am
by xNiclas Kühne
Following is a sample configuration for s9y on the lighttpd webserver (http://www.lighttpd.net):

Code: Select all

$HTTP["host"] == "www.s9y-site.com" {
  url.access-deny = ( ".tpl", ".inc.php", ".sql", ".db" )
  url.rewrite-once = ( "^/archives([/A-Za-z0-9]+)\.html"   => "/index.php?url=/archives/$1.html",
                       "^/([0-9]+)[_\-][0-9a-z_\-]*\.html" => "/index.php?url=$1-article.html",
                       "^/feeds/(.*)"                      => "/index.php?url=/feeds/$1",
                       "^/unsubscribe/(.*)/([0-9]+)"       => "/index.php?url=/unsubscribe/$1/$2",
                       "^/approve/(.*)/(.*)/([0-9]+)"      => "/index.php?url=approve/$1/$2/$3",
                       "^/delete/(.*)/(.*)/([0-9]+)"       => "/index.php?url=delete/$1/$2/$3",
                       "^/(admin|entries)(/.+)?"           => "/index.php?url=admin/",
                       "^/archive$"                        => "/index.php?url=/archive",
                       "^/categories/([0-9]+)"             => "/index.php?url=/categories/$1",
                       "^/plugin/(.*)"                     => "/index.php?url=plugin/$1",
                       "^/search/(.*)"                     => "/index.php?url=/search/$1",
                       "^/authors/([0-9]+)"                => "/index.php?url=/authors/$1",
                       "^/index\.html?"            => "/index.php?url=index.html",
                       "^/htmlarea/(.*)"                   => "/htmlarea/$1",
                       "/(.*\.html?)"                      => "/index.php?url=/$1",
                       "^/(serendipity\.css|serendipity_admin\.css)"       => "/index.php?url=/$1",
                       "^/(index|atom|rss|b2rss|b2rdf).(rss|rdf|rss2|xml)$" => "/rss.php?file=$1&ext=$2",
                     )
}
Don't forget to set the document root if you are not using simple virtual hosts and enable the rewrite and access module!

Niclas Kühne

Re: Installation on lighttpd with rewrite support

Posted: Sat Dec 10, 2005 7:57 pm
by garvinhicking
Thanks a lot for your contribution! I've also added it to our Technical Docs on www.s9y.org (http://www.s9y.org/119.html)!

Best regards,
Garvin

Posted: Fri Jan 20, 2006 4:37 am
by tklee
This line: [code]"^/index\.(html?|php.+)" => "/index.php?url=index.html", [/code]
should be taken out since quicksearch plugin would use

[code]index.php?serendipity%5Baction%5D=search&serendipity%5BsearchTerm%5D=mozart[/code]

to pass parameters into index.php.[/code]

Posted: Fri Jan 20, 2006 11:35 am
by garvinhicking
tklee, thanks! You are right, I adjusted the example!

Regards,
Garvin

Posted: Tue Nov 14, 2006 7:54 pm
by jkv
Besides the obvious benefit's of url.access-deny, what do the rewrite rules help?

Posted: Tue Nov 14, 2006 8:31 pm
by garvinhicking
Hi!

The rewrite rules help to make the URLs used by s9y look nicer. Some search engines and users prefer "speaking URL"s. :)

Best regards,
Garvin

Posted: Tue Nov 14, 2006 8:40 pm
by jkv
Oh, i thought it was something hanky panky ;)
I'll try out the rules then.

Posted: Sat Nov 25, 2006 1:25 pm
by Arnold Nijboer
Looks like i can use it, but can someone tel in what file i need to write it? does it go in an .htaccess file?

Greatings
Arnold Nijboer