drupal clean urls mit lighttpd

Da LightTPD leider nicht die Apache .htaccess und mod_rewrite Methode für clean urls in drupal unterstützt muss man das ganze etwas anders angehen. Schlüssel dafür ist mod_magnet und ein kleines lua script von datrix.
Als erstes einmal muss mod_magnet in den server.modules aktiviert werden. Bei Debian ist mod_magnet nicht bei den Standartmodulen dabei und muss nachinstalliert werden aptitude install lighttpd-mod-magnet. Danach muss eure url, für die clean urls aktiviert werden soll, bearbeitet werden, hier mal das Beispiel für tuxj0b.de.

$HTTP["host"] == "www.tuxj0b.de" {
   server.document-root = "/s/XXXXXXX/public/"
   server.name          = "www.tuxj0b.de"
   <strong>magnet.attract-physical-path-to = ( "/s/XXXXXXXXXX/private/drupal.lua" )</strong>
}

Die benötigte drupal.lua bekommt ihr hier.
In dieser Datei müsst ihr die Option local prefix = '/drupal' mit eurem drupal Unterverzeichnis ausgehend von der Webroot "/" ersetzten. Falls ihr drupal direkt in eurem Webroot liegen habt hilft local prefix = '' weiter. Denkt auch daran, dass die Datei die nötigen Zugriffsrechte hat, damit LightTPD die Datei lesen kann! Danach einmal /etc/init.d/lighttpd reload und clean urls werden unterstützt.

Post new comment

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockcode>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. Beside the tag style "<foo>" it is also possible to use "[foo]".

More information about formatting options