Installation on lighttpd with rewrite support

Having trouble installing serendipity?
Post Reply
xNiclas Kühne

Installation on lighttpd with rewrite support

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Installation on lighttpd with rewrite support

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
tklee

Post 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]
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

tklee, thanks! You are right, I adjusted the example!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jkv
Regular
Posts: 6
Joined: Tue Nov 14, 2006 6:39 pm
Contact:

Post by jkv »

Besides the obvious benefit's of url.access-deny, what do the rewrite rules help?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
jkv
Regular
Posts: 6
Joined: Tue Nov 14, 2006 6:39 pm
Contact:

Post by jkv »

Oh, i thought it was something hanky panky ;)
I'll try out the rules then.
Arnold Nijboer
Regular
Posts: 42
Joined: Mon Oct 23, 2006 7:48 pm
Contact:

Post 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
Post Reply