Configuring the Apache module mod_xsendfile: which .htaccess file do I modify?

328 views Asked by At

Our software updates reside in a private folder outside of the public root. To download them, users must log into our Drupal community so that it can check their permissions before retrieving the file. The current way these files are being retrieved, however, often fails when the files get large, downloading a 0kb empty file instead.

I was referred to the Apache module mod_xsendfile as the solution to this. The instructions discuss making modificaitons to an .htaccess file, but I'm not sure which to edit, or if I should create a brand new one.

For starters, my Drupal community is in a subdirectory of my main domain: http://example.com/community -- so there is an .htaccess file there. There's another .htaccess file as well in the root example.com public folder. If its either of these files, I assume it's the one in /community.

Or should a different .htaccess file be getting created elsewhere instead?

1

There are 1 answers

0
einord On

You should be able to create a .htaccess file in your web root folder and it should work. If you want to enable x-sendfile globaly in apache you can edit apache's httpd.conf file. (Not sure about other operating systems, but in Mac os x it is located in /etc/apache2/).

Hope this helps.