Advertising sustains the DA. Ads are hidden for members. Join today

Using Private Download with lighttpd

Last updated on
30 April 2025

You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules

  • If you use lighttpd as webserver the .htaccess-file won't do anything. But you can use mod_rewrite and a simple rewrite-rule to achieve the same functionality:
    1. Open the lighttpd-configuration-file (/etc/lighttpd/lighttpd.conf on debian).
    2. Look for the server.modules-variable, usually at the top of the file.
    3. Make sure you have a line "mod_rewrite", uncommented. It should look similar to this:
      server.modules = (
           "mod_alias",
           "mod_accesslog",
           "mod_compress",
           "mod_rewrite",
           "mod_redirect",
           #"mod_evhost",
           # "mod_evasive"
      )
    4. Add the rewrite rule:
      url.rewrite-once = ( "^/sites/default/files/private/(.*)" => "/system/files/private/$1" )

      Note: This may only work if you have clean URLs enabled (I use mod_magnet for that).

    5. Save the file and restart the web-server.

Help improve this page

Page status: Not set

You can: